Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a command that disables all programs and services from starting except the bare essentials. In msconfig this is called a diagnostic startup.

I am working on automating a lot of the work I do to clean up machines and it would be nice to have a .bat that could kill all user processes, remove temporary junk files and as mentioned, disable startup programs and services in one fell swoop.

Surely such a command exists?

A million thanks!

share|improve this question

At least for services you can use the command line program sc. It allows you to modify services (not just start/stop as with net).

For example, to disable and stop an Apache web server you could use this:

sc config apache2.2 start=disabled
sc stop apache2.2

You can use sc query to get a list of services, you might be able to parse with other command line tools (such as sed or grep; which are third-party though).

share|improve this answer
Probably the most relevant answer but not an effective resolution for what I need. Further research suggests what I want to do is not possible. Ideally, Windows would have some kind of environmental variable for programs and services that start up. This way, you could script a task without needing to know what the user has installed on the system. Thanks. – Scandalist Mar 11 '13 at 1:53

I haven't come across such a command, though I have been looking all over the net for something similar. However you could use msconfig in run, and disable everything you don't need and fiddle with start up. There is also a nice little program called CCleaner which cleans the registry and all the other rubbish from the PC. Those are the methods I use, and many many other people. It is quick and convenient.

share|improve this answer
Can you find and add a couple helpful links to your answer, like proper way to use msconfig, and link for CCleaner? – Lizz Mar 7 '13 at 0:57
This screenshot shows the first tab when you open msconfig from the Run dialogue. Just choose "selective startup" and untick "startup items" and "system services". You will probably be prompted to undo the change next time the system boots. This way you don't need to remember which services used to be enabled. – washbow Mar 7 '13 at 3:07
@Lizz Lamb kindly edited my question, so there is a link for CCleaner :). This link i suppose can be informative – Maciej Cygan Mar 7 '13 at 17:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .