1

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?

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

4 Answers 4

0

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()

0

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.

0

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"
NET STOP W3SVC
echo "Starting Apache"
NET START 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).

0

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.

You must log in to answer this question.

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