Copy file to all users desktop

batch-filepermissionswindows 7

I want to copy a file to all users desktop on Windows 7 by using a batch file with the command:

COPY C:\FOLDER\FILE.TXT %AllUsersProfile%\Desktop

But the message "Permission Denied" is shown. How can i get the batch file to request evaluated privileges so i can click "Yes" instead of just denying?

Best Answer

Assuming the user who is going to run the script has rights to put files in the "Public Desktop" folder:

  1. Create a shortcut to the batch file
  2. Right click the shortcut, go into properties
  3. On the Shortcut tab, click Advanced (Label A)
  4. Check the "Run as administrator" box (Label B)

Shortcut Advanced Dialog
(source: richard-slater.co.uk)