hatred Posted February 27, 2005 Share 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 ??? Link to comment Share on other sites More sharing options...
MCT Posted February 27, 2005 Share Posted February 27, 2005 net stop servicename Link to comment Share on other sites More sharing options...
hatred Posted February 27, 2005 Author Share Posted February 27, 2005 Thanks man Link to comment Share on other sites More sharing options...
Yzöwl Posted February 27, 2005 Share 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! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now