Solved

batch file

Posted on 2015-02-13
9
144 Views
Last Modified: 2015-02-13
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?
0
Comment
Question by:mkramer777
  • 5
  • 4
9 Comments
 
LVL 33

Expert Comment

by:paulmacd
Comment Utility
net start spooler
0
 

Author Comment

by:mkramer777
Comment Utility
any way to force it to run as administrator?  Right now I have to right click it and run as admin.
0
 
LVL 33

Accepted Solution

by:
paulmacd earned 500 total points
Comment Utility
0
 

Author Comment

by:mkramer777
Comment Utility
My run program as admin is grayed out
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 33

Expert Comment

by:paulmacd
Comment Utility
Create another batch file to run the first batch file as Administrator:

runas /savecred /profile /user:Administrator yourbatch.bat
0
 

Author Comment

by:mkramer777
Comment Utility
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?
0
 
LVL 33

Expert Comment

by:paulmacd
Comment Utility
"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.
0
 

Author Comment

by:mkramer777
Comment Utility
Thanks for your help.  I was able to convert it to an exe file and then I could tick run as admin.
0
 
LVL 33

Expert Comment

by:paulmacd
Comment Utility
Excellent!  Very happy to help.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now