Need help running a batch file as admin
I am trying to run a batch file as local system that uninstall previous Revu versions. I ran it both as a batch file and and also tried uploading it as a dependency. Tried to run it as System, Logged in user, with admin credentials. The batch file gets copied to the system but fails to run.. But if I go to the file and run it as an admin, it runs.
What am I missing or how can I run it as admin?
Try using double percent symbol for every variable.
I remember when we put a Bat in a script (not as dependency file, as a part of a task), we'd need to do this.
( i don't know why, but when whe create a new script, the option "run a batch file" isn't available.
First, we copy an existent script that run a batch file, and then paste the entire batch code in the script
Save and try.
Are you using variables that expand that path in the batch file? When running as SYSTEM, not all varibles are available to the batch environment. Test it with a hard path.
Also, test the batch with psexec. This allows you to test as SYSTEM.
the command is psexec -s -i cmd
you need to get it from systernals (ms download).