|
|
|||||||
Can anyone tell me how to disable a service under W2K? I know how to stop, start, pause, re-start and basically anything else I want to do to a service, but disable it. I am currently using NETSVC.EXE to stop/start services through a shell in my script. But I do need to disable the service because otherwise it will restart when the machine is rebooted. I have tried to use MONITOR.EXE to disable certain services, but it doesn't seem to work. I've checked Technet (an utter waste of time) and searched the web for an answer. I'm now turning to my fellow Kixsters to see if they have an idea. Thanks in advance, Z. |
||||||||
|
|
|||||||
try net start <service name> net stop <service name> I dont know if there is one for restart Code:
|
||||||||
|
|
|||||||
Bertje, That's basically what I do right now for starting / stopping a service and it works like a charm. I just need to disable the service so that it doesn't start at the reboot. I do the following : Quote: I loooked at using the "manual" arguement, but if the user launches an application that calls the service, it will start the service, and I can't have the service running during a migration. Thx, Z. |
||||||||
|
|
|||||||
have you ever heard of xnet ? Well, it comes with KiXtart distribution and it has the capability of starting/stopping/disabling/installing/removing services even remotely |
||||||||
|
|
|||||||
Oh happy, happy, joy, joy Thanks, never heard of XNET, always saw the directory with my kix sources, but never gave it much thought. I should have though, it worked like a charm. Thanks for the info. Z. |
||||||||
|
|
|||||||
To anyone else who may be interested in using "XNET MODIFY". I'd like to let you konw that, although it isn't mentioned in the help text file (xnet.txt) under the MODIFY section, the command to disable a service is the following (atleast its the one I used and it worked). Code: Shell '%comspec% /c XNET MODIFY "\\MACHINE NAME\SERVICE NAME" /s:DISABLE' l8r, Z. |
||||||||
|
|
|||||||
If you have WMI available on the target machines on which you want to disable the service, then WMIService() is available in the UDF library. You could use (for example): Code: $x = WMIService("messenger","STARTMODE","Disabled","computer_name") to disable the Messenger service on the remote computer "computer_name". |
||||||||
|
|
|||||||
And, oh wonder, there are even UDFs available for this: fnWMIService - Use the Win32_Service class of WMI to control services ServiceMode() - Checks/sets the startup mode of a service |