Link to home
Start Free TrialLog in
Avatar of mkramer777
mkramer777Flag for United States of America

asked on

batch file

I need to write a batch file in notepad to start the print spooler service if it has stopped.  Can anyone help me with that?
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

net start spooler
Avatar of mkramer777

ASKER

any way to force it to run as administrator?  Right now I have to right click it and run as admin.
ASKER CERTIFIED SOLUTION
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My run program as admin is grayed out
Create another batch file to run the first batch file as Administrator:

runas /savecred /profile /user:Administrator yourbatch.bat
other than typing in the name of the batch file instead of your batch.bat, is there any other specific info I need to input?  How does it know that I am talking about the batch file on the desktop?
"How does it know that I am talking about the batch file on the desktop?"
If you mean "How will it find where I've put the batch file I want to run?" you would include the path to the batch file as part of yourbatch.bat.  The "savecred" will prompt you for the password when you run it and save that password for future executions.
Thanks for your help.  I was able to convert it to an exe file and then I could tick run as admin.
Excellent!  Very happy to help.