Notice when you start windows in safe mode how fast it runs because there are only a minimal set of services started. Sometimes there are so many unnecesary services running that I feel like I want to clasify and start/stop depending on the task at hand. I do not want to open services.msc and start/stop each service. I'd like to have several scripts for using windows in different scenarios.

The thing is, this server is a lab kind of server, we test stuff there. If I want to have IIS, then I start service, but if I want apache, then I shut down IIS (I know I can set each one to different ports and run both, but, is not only those services)

Do you have or know of someplace that shares scripts (wsh or powershell or simply DOS batch)? Also, can you recommend some of your settings?

  • I dunno, starting Safe Mode on a 2008 SBS takes about 20 minutes, as opposed to 15 minutes under normal bootup... – Mark Henderson Aug 23 '09 at 21:44

You could try starting and stopping services remotely using PowerShell

To start the service:

(Get-WmiObject -Class Win32_Service -ComputerName WPDEV31 -Filter "Name=''").StartService()

To stop the service:

(Get-WmiObject -Class Win32_Service -ComputerName WPDEV31 -Filter "Name=''").StopService()


You can enable or disable services based on hardware profile. You create those profile with:

control panel=> system => hardware tab => hardware profile.

And then, on the services mmc on each service logon tab, you can specify on which hardware profile this service will run. The hardware profile is selected during boot.

I suspect that, in those happy times, most tester will use virtual machines to handle your scenario.


I had a similar scenario once where I needed to stop/start or restart a whole bunch of services.

I set up a bunch of batch files with NET START and NET STOP. For example:

@echo off
echo "Stopping IIS"
echo "Starting Apache"
echo "Starting Hamachi"
NET START HamachiSrv

Saved the file as "Apache-Hamachi.bat" and stuck them all in my quick launch. I had about a dozen of them depending on which services I wanted running (we had brokers of all different versions installed for in-house software).


Create a batch file to start or stop services is simple enough using the NET START and NET STOP commands. The hard part is knowing which services and particular test configuration is going to need running or stopped. This is something you really have to do yourself, as none of us can know your requirements as well as you do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.