View Full Version : how can i copy directories and subdirectories
pikolo543
02-10-2003, 11:20 AM
how can i copy directories and subdirectories and there files. in just one command in dos
i use copy command but it only copies file, all i need is one command to copy directories and all of its subdirectories and files.
please help me !!!!
thanks
Roelf
02-10-2003, 11:30 AM
xcopy /E
for all the switches, type xcopy /?
Code_gate
02-10-2003, 11:33 AM
I would suggest using the xcopy command rather thean the copy. If you specifiy the command to use the /s switch, it will tell dos to copy all the files in the current directory and any subdirectories within it.
An example of this in use would be:
xcopy c: a: /s
pikolo543
02-17-2003, 05:06 AM
ok thanks guys i will try your tip
timepilot
08-28-2005, 09:43 PM
If anybody actually tried moving directories to an a: drive using Xcopy you'll find out it doesn't work. You'll move the file in the folder from C:\ but you won't have it in a folder on a:\. I've used the /s & /e switches and it doesn't work. If anyone whos used this command can show me the code that actually works I'd appreciate it!
You can use "robocopy.exe" which can do great copying!
Source server - serverA
source directory - dirA
Destination server - serverB
destination directory - dirB
robocopy \\serverA\dirA \\serverB\dirB /s /e /r:10 /w:0 /z /sec
/s - copy subdirectories (files and folders)
/e - including empty dirs
/r:10 - try 10 times in case of a failure
/w:0 - wait zero seconds
/z - copy in restartable mode (when a failure occurs the whole file need not be copied but from the break point!)
/sec - copy security!!!
As you can see /z /sec are great options....
There are many many more options and this utility is free!
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.