I have to copy o folder(with subfolders and files) os size ~ 5GB. My requirements:
1) The batch should not stop even if it encounters an error(like unable to copy a particular file.)
2) should be able to log the error.
3) Should also show that the copy is sucessful ie the content of source and destination are same.
Any help will be appreciated.
Thanks
Copy a folder from local to remote machine
Moderator: DosItHelp
-
- Expert
- Posts: 391
- Joined: 19 Mar 2009 08:47
- Location: Iowa
-
- Posts: 4
- Joined: 21 May 2009 05:18
-
- Expert
- Posts: 391
- Joined: 19 Mar 2009 08:47
- Location: Iowa
the /f switch will give the full path.
I'm pretty sure that stdout will give you the successful copies, and stderr will give you failures. You can redirect stdout with the typical ">" redirect, which is actually "1>" for stdout (stream 1). You can redirect stderr (stream 2) with "2>" like this:
xcopy /f /e /c /h /v *.* path:\destination >success.txt 2>errors.txt
You'll have to test it to make sure it actually works like that.
Ted
I'm pretty sure that stdout will give you the successful copies, and stderr will give you failures. You can redirect stdout with the typical ">" redirect, which is actually "1>" for stdout (stream 1). You can redirect stderr (stream 2) with "2>" like this:
xcopy /f /e /c /h /v *.* path:\destination >success.txt 2>errors.txt
You'll have to test it to make sure it actually works like that.
Ted