Windows – Why Can’t I run a FreeFileSync batch file as Administrator

backupsyncwindows 7

I've created a FreeFileSync batch script with options that will preserve file permissions, this requires the script to be run with Administrative Privileges. I can't find an obvious way to run the script as an admin and because of that I created a shortcut to the script and attempted to have the new shortcut run as an admin, trouble is, the option to "Run as administrator" is grayed out.

How can I schedule my FreeFileSync batch to run periodically as the Administrator?

Thanks in advance.

Best Answer

The batchfile is being elevated.

What is happening is you are launching another process(FreeFileSync) from the batchfile. Unlike commands in a Command Prompt, which run inside the Command Interpretor, the new process is run as a User by default.

To elevate commands inside a batchfile, you'll need to use VBScript or JScript and the Windows Scripting Host. My recommendation is to use the Elevation PowerToy for Vista. The download contains example scripts.

You can also read the articles and example scripts on the website also.

Related Question