How to run cmd with Admin privileges using command line
Solution 1:
runas /profile /user:administrator “Driver:\folder\program”
For example, the administrator account is “AAA” and you want to run BBB.exe of C:\programs, you should follow these steps:
- Press Win key & R
- Input “CMD” in open box and click “OK”
- Input: runas /profile /user:AAA “C:\programs\BBB.exe” and press “Enter”
- Input the password of administrator AAA
- Press “Enter”
Hope it works.
Solution 2:
You can use runas.exe /savecred /user:administrator cmd
or refer this link