07-21-2023, 05:07 PM
I have a batch file called `test.bat`. I am calling the below instructions in the `test.bat` file:
start /min powershell.exe %sysdrive%\testScripts\testscript1.ps1
When I run this through the command prompt, my testscript is running successfully. I want to run it as administrator (as if I have created a desktop shortcut and run as administrator. It shouldn't prompt for any username or password).
I have tried adding `/elevate` and `/NOUAC` parameters in the above `test.bat`, but no luck. How do I fix this issue?
I know how to do it manually, but I want this to be executed from the command prompt.
(By [Marnix Klooster](
[1]:
start /min powershell.exe %sysdrive%\testScripts\testscript1.ps1
When I run this through the command prompt, my testscript is running successfully. I want to run it as administrator (as if I have created a desktop shortcut and run as administrator. It shouldn't prompt for any username or password).
I have tried adding `/elevate` and `/NOUAC` parameters in the above `test.bat`, but no luck. How do I fix this issue?
I know how to do it manually, but I want this to be executed from the command prompt.
(By [Marnix Klooster](
[To see links please register here]
)): ...without using any additional tools, like those suggested in [an answer to Super User question *How to run program from command line with elevated rights*][1].)[1]:
[To see links please register here]