-2

I'm trying to deploy shortcuts from xcopy using a batch script to c:\users\all users\desktop But this is a hidden folder with Hide Protected operating System files tick box under Folder options.

I need to run a command to allow me access copy a file to this directory.

So far I've tried running attrib -h c:\users\all users\, but it hasn't helped.

Any help would be greatly appreciated.

8
  • Do you get an error message?
    – MichelZ
    Apr 9, 2014 at 16:15
  • No the command completed successfully but that's only because it wasn't the correct command to run. The Attrib command doesn't seem to remove the tick box for "hide Protected OS System Files"
    – Jaoibh
    Apr 9, 2014 at 16:16
  • No, when you xcopy the files into that directory, you probably get an error, else you wouldn't ask this question I asume.
    – MichelZ
    Apr 9, 2014 at 16:18
  • Of course.. command I'm running is: xcopy "c:\NOCapps1\Shortcuts*.*" c:\Users\All Users\Desktop Error: Invalid Number of Parameters 0 File(s) copied... I run the same command but point it to my profile and it works.
    – Jaoibh
    Apr 9, 2014 at 16:23
  • 1
    Try putting the second one in " as well: xcopy "c:\NOCapps1\Shortcuts*.*" "c:\Users\All Users\Desktop" this is most likely the error ("All Users" has a space, your profile probably doesn't)
    – MichelZ
    Apr 9, 2014 at 16:31

2 Answers 2

1

C:\Users\All Users in windows 7 is a Symlink to the C:\ProgramData folder. The C:\Programdata\desktop folder is a junction back to c:\users\public\desktop.

If you are trying to copy data to the "all users\desktop" folder, try copying the shortcut directly to the C:\users\public\Desktop folder.

2
  • problem is non-quoted path with spaces and lack of privilegies, not a symlink. Apr 9, 2014 at 19:02
  • I've tried xcopy "c:\NOCapps1\shortcuts*.*" "c:\programdata\desktop" and I get access denied I've also tried copying directly to the public\desktop folder and get access denied also.
    – Jaoibh
    Apr 10, 2014 at 9:33
-1

Off the back of @MichelZ, @Rex and @LogicDaemon's suggestions I found the solution

xcopy "c:\NOCapps1\shortcuts\*.*" /i "c:\users\public\public desktop\"
1
  • The problem isn't resolved copying to the Public desktop doesn't put the files on every users desktop as I'd hoped.
    – Jaoibh
    Apr 10, 2014 at 16:41

Not the answer you're looking for? Browse other questions tagged .