Thursday, September 19, 2013

Enable and start a service via command line

One server
sc config spooler start= auto
sc start 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= auto

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