I have batch files that we need to occasionally run on users' PCs to install programs, fix issues, etc. The users are only Power Users, so some lines of some of the batch files don't work because of insufficient privileges. Running EXEs are fine, because I can go Run As. MSIs are also OK because we deployed a registry fix to add a Run As option to their context menus. But with Batch we are yet to find a solution.
Logging out and then logging in as admin is not an option.
What would be ideal is if we could place a file (probably a VBS script) in the same directory as the batch, and that it would prompt for username password, then somehow pass those credentials onto the batch file.
If not, is there a way to put some command inside the batch file (and supply credentials in the script) to run parts of the script as admin? This would then need to be hidden from the user, by encryption or by converting to an EXE or something like that.
I have seen this link below but I don't know how to make it relevant to batch files:
Thanks for your help.