Thursday, September 19, 2013

Disable and stop a service via command line

One server
sc config spooler start= disabled
sc stop spooler

Multiple Servers
List servers in a file named C:\servers.txt

for /f %x in (C:\SERVERS.TXT) do sc %x config spooler start= disabled

for /f %x in (C:\SERVERS.TXT) do sc %x stop spooler