This tutorial shows hot to make an executable script that disables an specific service in Windows XP/Vista.
Hi there. I will try to show how to create a batch script for experimental purposes that disables a service in Windows XP and Vista.
First of all, we have to open the aplication Notepad. It can be found in Home > All programs > Accesories > Notepad, and also can be opened if we open the Run command (Windows + R) and write (without quotes) “Notepad”.
In this example, I will show you how to disable de Windows Update service, but you can modify the script in the 7th line (at the end of line, just between the single quotes). Note that the Windows Update service is named as “wuaserv”. To know how other services have to be named, refer to Google and search for it, or try in the “Services” console. To do this, first open de Run window (Windows + R) and then write “services.msc” and press the Enter key. Once on the Services Console, select the desired service and double click on it. In the “General” tab, watch the first line and note the name of the service. This name have to be replaced on the 7th line of the code I provide you.
Once we have the Notepad windows in the screen, lets write some code lines (easy!):
Archivodisable.vbs
Code Snippet
strComputer = “.”
Set objWMIService = GetObject(”winmgmts:” & strComputer & “rootcimv2″)
Set colServiceList = objWMIService.ExecQuery _
(”Select * from Win32_Service where Name = ‘wuauserv’”)
For Each objService in colServiceList
If objService.State = “Running” Then
objService.StopService()
Wscript.Sleep 5000
End If
errReturnCode = objService.ChangeStartMode(”Disabled”)
Next
Then, we have to save our work going to File > Save as… an then, rename the file to “Archivodisable.vbs”. Make sure that the file name is correct (both name and extension) and then, you are ready to stop and disable the Windows Update service! Feel free to modify this script to make it useful according to your needs.










