# How to write a script for services.msc



## kevin82485 (Jun 19, 2011)

I was wondering if someone could help me, or point me toward, a script for disabling unnecessary services in a Windows based OS. I know which services I want to disable, I just want a one click method to do it.


----------



## Frank4d (Sep 10, 2006)

You can write a batch file using the *sc* command to disable services. The following lines in a batch file stops the print spooler and audio services, and disables them from starting again (not that you would want to disable these two):

sc stop spooler
sc config spooler start = disabled
sc stop audiosrv
sc config audiosrv start = disabled


----------



## Squashman (Apr 4, 2003)

You can use the * NET* coomand to start and stop services.

Net stop sevicename


----------

