This should work for you using your blat util... Just save as a vbs file...
dim WshShell, Service
Set WshShell = WScript.CreateObject("WScript.Shell")
Set Service = GetObject("WinNT://servername/servicename") 'Change Servername
and ServiceName
on error resume next
Service.stop
if err <> 0 then
WshShell.Run "blat command", 1, True 'blat couldn't stop service
end if
on error goto 0
wscript.sleep 5000
on error resume next
Service.start
if err <> 0 then
WshShell.Run "blat command", 1, True 'blat couldn't start service
end if
Set Service = Nothing
Landon.
-----Original Message-----
From: Cornett, Keith [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 2:52 PM
To: NT 2000 Discussions
Subject: Check for a running service script
Hello,
I'm in need of a batch job or script that restarts a service, then checks to
ensure the service started successfully. The second part (which I have), is
if the service failed to start, a blat command will send a page. Does
anyone
have something like this?
Thanks,
Keith Cornett
SBS, Inc.
------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to %%email.unsub%%
------
You are subscribed as [email protected]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to [EMAIL PROTECTED]