Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


A script to stop 2 services and then restart them...

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,53535
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> A script to stop 2 services and then restart them...
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 A script to stop 2 services and then restart them... - 11/14/2007 12:10:42 AM   
  ZoSoSwiM

 

Posts: 5
Score: 0
Joined: 8/27/2007
Status: offline
Hi everyone. I have a service running on my server which needs to be restarted every morning for a program to work.. I've checked everything to figure out why it's turning off but I have bigger things to worry about. I want to make a script to put in my scheduled tasks which will run every morning at lets say 7am.

I need make sure both services are stopped. Restart 1, then after a bit restart the other. What is the best option for this?
 
 
Post #: 1
 
 RE: A script to stop 2 services and then restart them... - 11/14/2007 1:42:04 AM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
This has been asked a million times, whats wrong with the search feature.


      

(in reply to ZoSoSwiM)
 
 
Post #: 2
 
 RE: A script to stop 2 services and then restart them... - 11/15/2007 8:31:21 AM   
  sheepz


Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
the search feature is for aesthetic  reasons only 



as for your simple stop and restart request, you dont really need vbs for this.  you can use a .bat file and set it with your task scheduler at 7am:

.bat file
--- begin ---
net stop <service>    <---- stop desired services
net stop <service>
start /wait net start <service>   <--- start desired service /wait cmd to wait until service has started before continuing to next cmd line
net start <service>
--- end ---




< Message edited by sheepz -- 11/15/2007 8:43:58 AM >

(in reply to ZoSoSwiM)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> A script to stop 2 services and then restart them... Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts