Click here to Skip to main content
15,914,780 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
I have a batch file called test.bat, i am calling the below instructions in 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(like i have created a desktop item 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. can someone help me how to fix this issue?

I know how to do it manually but i want this to be executed from the command prompt
thanks in advance.
Posted
Comments
Sergey Alexandrovich Kryukov 23-Nov-11 22:08pm    
Have you been banned by Google? :-)
--SA

Start>>Command prompt>>right click Run as Administrator

an then run your file
 
Share this answer
 
You could open the command prompt as administrator, then use it to run the program.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900