DesktopEngineer.com Training & Services
All Articles Engineer's Toolbox App Mgmt Win7 - Vista Windows Installer Training News Scripting VMs RSS Feeds
FREE: Speed Up Windows with DesktopEngineer.com's WinServicesTuner.vbs
11/5/2008 10:15 pm
Contributed By: Darwin Sanoy

I wanted an automated way to optimize the services running on my training VMs and real machines as well, but every script I checked out was unsatisfactory - so you know what means ...

I stole all the best ideas, mixed in some of my own cool stuff and baked my own. 

Inside the main script is some cool generalized code for dealing with Vista UAC / XP RunAs elevation requirements.

Here are the details:

Sample usage scenarios:

  • Optimize real machines - make real machines run faster.
  • Initial computer build / existing machines - this script works equally well to prepare a machine for imaging, to be run during first boot or to be run on existing machines.
  • Optimize virtual machines - virtual machines - especially those used for testing - can be significantly optimized by shutting down unneeded services.
  • Home Computers - home machines can be especially burdened with extra services intended to be used in corporate environments for managing many things not present in a home network.
  • Service Configuration On Demand - turn off or pause unnecessary services when running intensive applications like games.  For application specific services, leave them turned off and only turn them on when the software is in use (sample script for VMWare included - with UAC).
  • Detecting New Services - on a regular basis or after a software install.
  • System Hardening - create service profiles that disable unneeded services for better system security.

Significant Features:

  • Full Featured - most scripts that perform services optimization focus on disabling services (not setting to ANY mode) and generally do not account for being able to undo changes and have multiple configuration files for different purposes.
  • Manages both Service Run States and Startup Modes - any specific run of the script can change either or both of these attributes for some or all of your services.  This makes it useful for applications such as service startup modes for system optimization or for temporary service disablement (e.g. to play intensive games) or to leave application specific services off until they are actually needed (run script to startup services => start app => app ends => run script to shutdown services)
  • Multiple Configuration Files - examples "XPSP3_memoryoptimized", "XPSP3_VM_minimal", "XPSP3_defaults", "MyServicesBeforeChanges"
  • Unlimited Undo - serialized undo files are produced with each run of the script.  The most recent is available with a simple command line switch.
  • Save Existing Service Configuration - for building custom templates, to return to a known state or to save service changes made manually in control panel.
  • CSV Configuration File Format - easy to edit and compare.  Same data fields that would be output by any WMI call.
  • Only Managed What You Need To - simply remove services from the configuration file if you aren't managing them or if certain ones should never be disabled or reconfigured.
  • Easy of Use - uses full service names from control panel to avoid need to constantly lookup a service's registry name.
  • UAC Prompt Handling - If you accidentally run the script without first having admin rights, it automatically prompts for UAC and relaunches itself.  Can be disabled for non-interactive runs using "-nouacprompting" which causes the script to generate an error if it does not have admin rights. 
  • Commenting Files - Configuration files can have comments via records that contain a non valid start mode or run state.
  • Quick - use of database objects to read services configuration files allows a single control pass over all services to configure the entire set.
  • Logging -basic and verbose logging tell what services were changed, what ones could not be changed (and the full text error message) and what ones were discovered on the machine that were not in the configuration file.  To generate a log file, redirect the script output to a file.
  • Command Line Switch Validation - validate command line and produce useful error messages.
  • Integrated Help - use "/?" or "/help" to receive help.

Overview and Download page 

Topic: Engineers Toolbox, Scripting

[Print Page] [Site Map] [Search] [Contact Us]


© 2009 DesktopAdmin.com, Inc.
All trademarks and copyrights on this page
are owned by their respective owners.