hatred Posted February 27, 2005 Posted February 27, 2005 im makeing a bat file thats shuts down a whole bunch of services ive listed and would like to know if you use start sc stop wuauserv would it be like this. start /wait sc stop wuauserv or start sc stop wuauserv /wait ???
Yzöwl Posted February 27, 2005 Posted February 27, 2005 Using the SC command in a cmd file you can do it pretty neatly like this:@ECHO OFFSETLOCALSET NoGo=Alerter Browser CiSvc ClipSrv ERSvc HidServ lanmanserver LmHosts Messenger mnmsrvc NetDDE NetDDEdsdm Netlogon Nla RDSessMgr RemoteAccess RSVP SCardSvr seclogon srservice SSDPSRV SysmonLog upnphost UPS W32Time WebClient WmdmPmSN WmiApSrv wscsvc WZCSVC XmlprovFOR %%s IN (%NoGo%) DO SC query %%s | FIND /i "RUNNING"IF ERRORLEVEL 0 SC stop %%sENDLOCALEXITThis should check if each of the thirty one example services in the space separated list is running and if it is stop it!
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now