Create Batch File to Start or End Window Services

Home -> Windows -> Batch File Programming

155473 views

From the computer of: davak (396 recipes)
Created: Nov 28, 2003     Updated: Nov 06, 2005


6 comments:
View all comments

Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

The windows environment can be easily changed by starting or ending various windows services. For example, this method can be used to easily shut down multiple services for a performance boost during game playing.

Warning: Manipulating windows services can have unpredictable effects on your system. You should create a system restore point before experimenting.

We all want to tweak or windows systems to the extreme to get the quickest, most powerful system possible. Many people will disable multiple window services manually before game playing. What a pain!

Many times people forget what the services do or forget to restart the important ones. Services can be easily changed by creating batch files.

The important commands are the following:
NET START - starts the service
NET STOP - ends the service

For example:

NET STOP "Error Reporting Service"


Output: The Error Reporting Service service was stopped successfully.

Knowing the commands, one can now easily create batch files called something like beforegame.bat and aftergame.bat.

Before.bat would contain all the NET STOP commands to end the nonessential services.
After.bat would be exactly the same except all the NET STOP commands would be replaced with NET START commands to restart all the common services.

A sample of the before.bat file might look something like this:

NET STOP "Error Reporting Service"
NET STOP "FTP Publishing Service"
SET STOP "IIS Admin"
NET STOP "Messenger"



Likewise, the after.bat file might look something like this:

NET START "Error Reporting Service"
NET START "FTP Publishing Service"
SET START "IIS Admin"
NET START "Messenger"



You may wish to reference this: list of services that can be disabled.

If your system ever becomes unstable and you want to return the services to their default settings, the default settings for the windows services can be found here.

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.




6 Recipe comments: View comments

Create Batch File to Start or End Window Services by mrdance
very helpful by Anonymous
How to have profiles of services by GeoMax
Start if Stopped by Anonymous
batch file to control windows services by Anonymous
Re: Create Batch File to Start or End Window Services by WebNut



Related recipes:

  XP batch files: Create variable for current user account and find current user
  Supressing Prompts In Batch Files While Deleting All Files
  Supress Responses From Commands In Batch Files
  Using variables in Windows batch files
  Batch Files : Get users default printer via registry (WinXP)
  XCOPY command : Using the /EXCLUDE flag
  XP Batch Files: Copy images from camera to pc and organize by date
  Windows XP/Vista: Use a Batch File for Quickly Restarting explorer.exe
  Batch File Converting of Video Files: SageTV example
  Processing the contents of a text file using FOR loop

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.