In this gist, we see how to run any .bat file (or any executable at all) either elevated ("Run as administrator") or with specific user credentials, all without any interaction from the user.
This is particularly useful in creating a GPO to pass out to network users to run a patch or script that requires specific permissions.
Create a batch file that will be pushed out to users via GPO, following the example in "RunAsOther script.bat" (below)
- Replace {TaskName} with a unique name for your task. I suggest including a datestamp
- Replace {\path\to\my.bat} with the path to your .bat file or executable that needs to be run on the user's machines.
- Replace {domain\username} with the domain and username of the account you want to use to run this task. [OPTIONAL]