You may get better ideas than this, but here goes.
First, this sounds like a band-aid kind of deal.
Second you need to know the Service Name as opposed to the Display Name.
More on that below.
Any of these commands work in the command prompt or a .bat or .cmd file,
commonly called Batch files or Scripts. .bat files will work on all Windows
versions and .cmd files will only work on Windows NT, like Windows XP (which
is NT 5.1) or Windows 2000 (NT 5.0), etc.
SC is a command line program used for communicating with the NT Service
Controller and services.
You can type: sc /? in a command prompt for help on the SC command.
You can also paste the following line into Start | Run and click OK...
hh ntcmds.chm::/sc.htm
for more Help on the SC command.
sc query servicename
For example..
lanmanserver is the Service Name for the Server Service (the Display Name).
sc query lanmanserver
will show if the Server service is running, stopped or paused.
But I think that we can skip the sc query bit.
The Net Start command starts a service.
net start servicename
For example..
net start lanmanserver
You could just have a .bat file with the following two lines...
@ echo off
net start servicename
If the service is already running you will get this message.
The requested service has already been started.
But the error will flash by so quick, you cannot even read it.
Open Notepad, add these two lines:
@ echo off
net start servicename
Replace servicename with the service's actual Service Name.
Save the file as Somename.bat
Then you can just double click Somename.bat whenever to run it or you can
probably schedule it to run every 5 minutes or something.
Services - Service Name & Display Name
To find the Service Name.
There are several ways to do this. Here are three that I know of.
Open Services...
Start | Run | Type: services.msc | Click OK |
Scroll down to and double click the service you want to stop |
On the General tab, Service name: take note of the Service Name not the
Display Name | Close Services
Look in...
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
The command:
sc query state= all
will display the SERVICE_NAME and DISPLAY_NAME of all services & drivers.
Any commands using the command prompt will require using the Service Name
not the Display Name.
I.e. Net Stop, Set Start, SC commands, etc.
--
Hope this helps. Let us know.
Wes
MS-MVP Windows Shell/User
In