while running certain command in windows powershell, it returned with a message " Access denied. Option -c requires administrative privileges.", so in linux (ubuntu) we use 'sudo' right, but how should I do it in windows.
Asked
Active
Viewed 886 times
1 Answers
0
This code will require admin rights if the batch is not started as admin:
net session >nul 2>&1 || (powershell start -verb runas '"%~0"' &exit /b)
Ricardo Bohner
- 5,221