Link to home
Start Free TrialLog in
Avatar of itbabe
itbabe

asked on

Vbscript : I need to kill a service using vbs

please help
Avatar of bsharath
bsharath
Flag of India image

Kill a service you mean stop and delete?

Click Start -> Run -> Cmd.exe -> OK
WMIC /NODE:"Remote_Machine_Name_Here" /USER:Administrator /PASSWORD:P@ssW0rd SERVICE WHERE Name="Service_Name_Here" CALL StopService

This will stope and remove a service.

::stop, disable and remove
@Echo Off
setlocal
set service=dwmrcs
FOR /F %%c IN (C:\computers.txt) Do (
      Echo stop service %%c
      sc \\%%c stop %service%
      sc \\%%c config %service% start= disabled
      sc \\%%c delete %service%
)

Save as a bat file and have all the computernames in the txt file
Set the service name
set service=dwmrcs
ASKER CERTIFIED SOLUTION
Avatar of merowinger
merowinger
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cup
cup

Does it really need to be in vbs?  Can't you just do it in a dos box

net stop servicename

To start it

net start servicename