Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to move a full folder?  (Read 3419 times)

0 Members and 1 Guest are viewing this topic.

bakugo

  • Guest
How to move a full folder?
« on: April 30, 2011, 01:33:25 PM »
So, i have a big folder with other folders and files inside it.
Whats the Batch command to move it to another location?

Linux711



    Mentor

    Thanked: 59
    • Yes
    • Programming Blog
  • Certifications: List
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: How to move a full folder?
« Reply #1 on: April 30, 2011, 01:42:37 PM »
I would do this, but there may be a better way. As far as I know the move command doesn't work for a directory tree.

Code: [Select]
XCOPY "[source folder here]" "[destination folder]" /E /C /R /I /K /Y
RD "[source folder]"
YouTube

"Genius is persistence, not brain power." - Me

"Insomnia is just a byproduct of, "It can't be done"" - LaVolpe

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: How to move a full folder?
« Reply #2 on: April 30, 2011, 01:56:23 PM »
Moving large Trees with DOS is not a very good idea.
The likelihood of error is rather high.
Files may be in use or marked as read-only which will cause errors.

First copy, then if no errors, remove original files and folders. Better yet, use a program made to do this kind of work.  Windows has a application call 'Sync Toy' that could be used.

Quote
SyncToy 2.1
Brief Description
SyncToy 2.1 is a free application that synchronizes files and folders between locations. Typical uses include sharing files, such as photos, with other computers and creating backup copies of files and folders


Linux711



    Mentor

    Thanked: 59
    • Yes
    • Programming Blog
  • Certifications: List
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: How to move a full folder?
« Reply #3 on: April 30, 2011, 02:03:36 PM »
Quote
Files may be in use or marked as read-only which will cause errors.

The /E /C /R /I /K /Y should take care of that. As for the being in use, it would behave the same way in GUI, right?
YouTube

"Genius is persistence, not brain power." - Me

"Insomnia is just a byproduct of, "It can't be done"" - LaVolpe

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: How to move a full folder?
« Reply #4 on: April 30, 2011, 02:32:17 PM »
The /E /C /R /I /K /Y should take care of that. As for the being in use, it would behave the same way in GUI, right?
No. It depends. But you can use Robocopy
Quote
While still included in Windows Vista, Xcopy has been deprecated in favor of Robocopy, a much more powerful copy tool, which is now built into the operating system.
http://en.wikipedia.org/wiki/Robocopy