If you have the resource kit, sc.exe will do this for you.
###########################################################
sc config -?:
Modifies a service entry in the registry and Service Database.
SYNTAX:
sc <server> config [service name] <option1> <option2>...
CONFIG OPTIONS:
NOTE: The option name includes the equal sign.
type= <own|share|interact|kernel|filesys|rec|adapt>
start= <boot|system|auto|demand|disabled>
error= <normal|severe|critical|ignore>
binPath= <BinaryPathName>
group= <LoadOrderGroup>
tag= <yes|no>
depend= <Dependencies(separated by / (forward slash))>
obj= <AccountName|ObjectName>
DisplayName= <display name>
password= <password>
###########################################################
If you don't have that or don't want to use it, you could try a poor man's
version something like:
net stop NameOfService
echo Windows Registry Editor Version 5.00>C:\service.reg
echo.>>C:\service.reg
echo
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NameOfServiceInRegistr
y]>>C:\service.reg
echo "Start"=dword:00000003>>C:\service.reg
regedit /s C:\service.reg
del C:\service.reg
Ray at work
Brian said:
I have a need to both stop and set the service to manual
through a batch file. Is there a switch or something I can
use to do this? I would envision something like:
net stop xxx -m
Any help would be appreciated.