How can I create a public share for xcopy or robocopy on Windows 7?

Jakerue October 7, 2010
Pinterest Stumbleupon Whatsapp

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?

Ads by Google

  1. Anonymous
    October 7, 2010 at 12:08 pm

    HiTry CopyRight2 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.