How can I auto-elevate my batch file, so that it requests from UAC administrator rights if required?
I want my batch file to only run elevated. If not elevated, provide an option for the user to relaunch batch as elevated. I'm writing a batch file to set a system variable, copy two files to a Program Files location, and start a driver installer. If a Windows user (UAC enabled *) and even if they are a local admin) runs it without right-clicking and selecting "Run as Administrator", they will get 'Access Denied' copying the two files and writing the system variable. I would like to use a command to automatically restart the batch as elevated if the user is in fact an administrator. Otherwise,
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.