Forum Home
Press F1
 
Thread ID: 70548 2006-07-07 02:14:00 XP Batch file > copying files over network jermsie (6820) Press F1
Post ID Timestamp Content User
469160 2006-07-07 02:14:00 I would like to know how to write a batch file to copy whole directories of files across the network to another computer (or external drive connected to it).
I saw my brother do it when copying stuff to my machine but that was a long time ago.
And sites that could be of help directly related?
jermsie (6820)
469161 2006-07-07 04:31:00 Well now, that depends on the network, Novell you can use ncopy, windows network u can use xcopy, both will keep rights and archive info.
Normal copy does neither.
For options, use the /? switch after the executable to get list of syntax.
Create a file with notepad and sav with .bat extension.

There is also a program called robocopy(?) with I think has a GUI if not good with command lines.
SolMiester (139)
469162 2006-07-07 04:56:00 I'd use Syncback (www.2brightsparks.com) or MS SyncToy (www.microsoft.com)

or set up rsync for Windows....
gibler (49)
469163 2006-07-07 05:17:00 This is a command I use in a batch file for doing exactly what you want.

xcopy "source" "destination" /s /y /c /h /r /k /o /q

I can't remember exactly what each switch does, but you can look them up at the command prompt with xcopy /?

both source and destination can be either local paths (eg c:\path) or network paths (eg \\server\path)

if either the source or destiantion folders contain long names or spaces, ensure you put quotes around the full path.
craig.b (6571)
1