Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.