Sunday 27 September 2009

How to start and stop a service using command line

This method of starting and stopping a service applies to all Windows based operating systems e.g. Windows 2000, XP, Vista and Windows Server 2000/2003.

The first thing you will have to know is the name of the service you want to stop or start. You can find this by going to the services list :

1.Winkey + r
2. Type 'services.msc'
3. Locate the service you wish to start/stop and righ click>properties
4. The Service name is shown at the top on the general tab.

For my example i am going to use Internet Information Server (IIS) as the service i wish to stop. It's service name is 'w3svc'. So once you have the name then perform the following :

1. Winkey + r (or start menu and then click 'Run')
2. Type 'cmd' and press enter to bring up a command prompt.
3. Type Net Start or Net Stop (depending on what action you wish to perform) and then the service name e.g. 'Net stop w3svc'. Press enter.
4. In the above instance the command prompt window would show the messages "The World Wide Web Publishing service is stopping." and "The World Wide Web Publishing service was stopped successfully".

So, to start the service back up i would just use the Net start command.

No comments:

Post a Comment