| | If I want to start, stop a service or set a service to automatic,
| manual or disabled I go to MMC / Services and press the appropriate
| buttons. What I would like to <SNIP> configure select services with
| a one-click operation. For example, if I want to start or stop the
| service Event Log or change it to manual or automatic for the next
| re-boot I would like to be able to configure an application to do
| that for me. I would also like to be able to save various
| configurations. <SNIP>
The (built-in) command line SC tool (C:\WINDOWS\system32\sc.exe) can
be used to configure services. Sc.exe provides capabilities similar
to Services in the Administrative Tools item in Control Panel. And
for "one-click operation" you could use a batch file that calls
various Sc.exe commands. For more information search the Help and
Support Center for the word: SC
And if you need any help creating batch files I recommend searching
the Google Archives using the following query and reading through
some of the previous answers to this question:
"sc.exe"
group:microsoft.public.win2000.cmdprompt.admin
(MVP OR MSFT OR MS)
http://www.google.com/groups?as_ugr...dprompt.admin&as_epq=sc.exe&as_oq=MVP MSFT MS
And if more help is needed with batch files I recommend posting in the
newsgroup: microsoft.public.win2000.cmdprompt.admin
If you read the newsgroups using the Microsoft Communities Web Page,
here is a link:
http://communities2.microsoft.com/c...uery=microsoft.public.win2000.cmdprompt.admin
If you read newsgroups using a NNTP newsreader, such as Outlook
Express, and use the msnews.microsoft.com news server, here is a link:
news://msnews.microsoft.com/microsoft.public.win2000.cmdprompt.admin
More Information:
Sc.exe uses the service key name from the registry. This name is
different from the display name as seen in services.msc. For example,
the service key name Eventlog has a corresponding Name in services.msc
of Event Log. For a document that includes the service key name of
all the system services that are included as part of the Windows
Server 2003 Family and Windows XP Operating Systems see the following
document:
TechNet Home | Products & Technologies | Server Operating Systems |
Windows Server 2003 | Management Services:
http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/management/svrxpser.mspx
And for a quick and easy way to output the Short Names, the Current
State (such as Running or Stopped), and a description of all system
services that are installed on the local computer, see the script in
the following Microsoft Knowledge Base Article:
KB271362 - How to Find the Short Names of Services
http://support.microsoft.com/?scid=271362
Note: Instead of directing the output of the VBS file to the command
prompt window (as explained in the Knowledge Base Article) you can
redirect the output to a text file named services.txt by opening the
command prompt (cmd.exe) to the directory that contains the VBS file
and using the following command:
cscript services.vbs > services.txt
Even More Information:
- In addition to the blackviper Web Page mentioned by DILIP, I have
found the following Web Page about Services very helpful. In
particularly, the section titled "Restoring a Service" clearly
explains how to set service startup types using the registry editor.
3DSpotlight Windows XP Services Tweak Guide
http://www.techspot.com/tweaks/winxp_services/print.shtml
- Before reconfiguring your System Services, I recommend that you open
services.msc | [Menu bar] Action | Export List... and save this file
so that you have a list of the installation default settings. For
ease of reading import it into a spreadsheet program such as Excel.
- Do not change the default Startup Type of the Logical Disk Manager
Administrative Service (Manual). For more information, see the
following Microsoft Knowledge Base Article:
KB307309 - The Logical Disk Manager Administrative Service Hangs
While It Is Starting
http://support.microsoft.com/?scid=307309
- Do not change the default Startup Type of the Remote Procedure Call
(RPC) Service (Automatic). Many services depend on it and if it fails
to start (or hangs) problems include Service Properties Sheets not
displaying. For more information see the following Microsoft
Knowledge Base Article which also describes how to use the registry
editor to configure the service to use the built-in system account.
KB314357 - "Event ID: 7000" or "Event ID: 7013" Error Message When You
Attempt to Start a Service
http://support.microsoft.com/default.aspx?Product=winxp&scid=kb;en-us;314357
- And lastly, if you misconfigure services and you get a message
saying that "Windows did not start successfully" choose "Last Known
Good Configuration" as your boot option. This will restore the
registry settings for Services (etc.) that where used in the last
successful boot. Avoid logging on because if you do the Last Known
Good Configuration control set will be overwritten.
The registry value "LastKnownGood"= points to the ControlSet that
would be used if you choose "Last Known Good Configuration" as a boot
choice. For example, if you registry shows:
[HKEY_LOCAL_MACHINE\SYSTEM\Select]
"LastKnownGood"=dword:00000002
"Last Known Good Configuration" would boot:
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002]
For more information about LastKnownGood see the following:
Microsoft Windows XP Professional Resource Kit Documentation | Part VI
System Troubleshooting: Chapter 28 - Troubleshooting Startup
SECTION: Restoring to the Last Known Good Configuration
http://www.microsoft.com/resources/documentation/Windows/XP/all/reskit/en-us/prmc_str_jzxi.asp