Readers like you help support MUO. When you make a purchase using links on our site, we may earn an affiliate commission. Read More.
How can I use xcopy or robocopy to copy files from the public share directory to my Windows 7 machine?
I am running this as a batch script from the Windows 7 box, to another Windows 7 box on startup. I want to sync what's in that directory with my machine - so far fail.
xcopy \\mywin7box\Users\public C:\FilesIwant\here /s
robocopy \\mywin7box\Users\public C:\FilesIwant\here
This as been tried with no success. I get failing parameters on both xcopy and robocopy. Ideas?
2010-10-07 12:08:00
HiTry CopyRight2
http://www.sys-manage.com/SYSMANAGE/CopyRight2ComparedwithotherSolutions/tabid/198/Default.aspx
Try robocopy with this command:c:robocopyrobocopy.exe "D:public" "\servernamed$public" /e /sec /ZB /r:1 /w:0If your using /sec then robocopy sometimes doesn't copy the permissions of (only) the source folder correctly, so before you run a copy command including permissions, pre-create the target folder with the correct permissions. Subfolders and files will be copying okay.If robocopy does not copy the shares, only the NTFS permissions. Try thisafter copy the info, you can try to export the registry folder -->[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServic eslanmanserverShares]from the original server to the target server. Remember that if you copy theinfo to the target server on another path (ex: Z: --> Y:) You need tomodify the export registry file with the new path. Good Luck.