JSI Tip 3444. How do I find the short name of a service?


If you use Windows NT 4.0 (or Windows 2000), you can locate the short name of a service by:

1. Open a CMD prompt and type net start. You will receive a display similar to:

These <Your O/S> services are started:

   Alerter
   . . .
   Application Management
   IIS Admin Service
   Indexing Service
   . . .
   Workstation
   World Wide Web Publishing Service

The command completed successfully.
2. Use Regedit to navigate to:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.

3. Use Edit / Find to search for the display name. Check the Data box. The display name will be found in the DisplayName value name. The key of this entry is the short name.

If Windows 2000 is installed:

1. Administrative tools / Services.

2. Right click the service's display name and press Properties.

3. Select the General tab.

4. The Service name: label lists the short name.

NOTE: The display and/or the short name may be different between Windows NT 4.0 and Windows 2000. Example of the Routing and Remote Access service:

  Operating System     Display name     Short name  
  Windows NT 4.0     Routing and Remote Access Service     Router  
  Windows 2000     Routing and Remote Access     Remoteaccess  

For both operating system, you can use a script in combination with WMI (Windows Management Instrument). WMI is included with Windows 2000. For Windows NT 4.0, download WMI here.

The SvcDnSn.vbs script, which must be run from a CMD prompt, contains:

'********************************************************************
'* File:        services.vbs
'* Purpose:     display service information on a computer using WMI 
'* Requires:    WMI to be installed on server specified
'* Revisions:   Initial development - 01/08/01, tonymu
'* Disclaimer:  This code is to be used for sample purposes only
'*              Microsoft does not guarantee its functionality
'********************************************************************
'Known Issues:
'   The following error will be returned if WMI is not installed
'        \[path-to\]\services.vbs(23, 1) Microsoft VBScript runtime error: ActiveX component can't create object: 'GetObject'

Dim oArgs, strServerName, oServiceSet, oWshNetwork

Set oArgs = WScript.Arguments
If oArgs.Count > 0 Then
   strServerName = trim(oArgs(0))
Else
   strServerName = "LocalHost"
End If
Set oServiceSet = GetObject("winmgmts:\{impersonationLevel=impersonate\}!//" & strServerName & "/root/cimv2").InstancesOf("Win32_Service")
If strServerName = "LocalHost" Then
   Set oWshNetwork = WScript.CreateObject("WScript.Network")
   WScript.Echo "Service Information retrieved from " & oWshNetwork.ComputerName
   Set oWshNetwork = Nothing
Else
   WScript.Echo "Service Information retrieved from " & strServerName
End If
WScript.Echo String(75, "_")
For each Service in oServiceSet
	WScript.Echo
	WScript.Echo "   " &  Service.DisplayName 
	WScript.Echo "   " & Service.Description
	WScript.Echo "      Short Name:    " & Service.Name 
	WScript.Echo "      Current State: " & Service.State
Next
WScript.Echo String(75, "_")
Set oServiceSet = Nothing

I prefer to type:

netsvc \\ComputerName /List

Sample output:

Installed services on \\jsi005:
        <Abiosdsk>,  No separate display name
        <IISADMIN>,  Display name is <IIS Admin Service>
        <WMDM PMSP Service>,  Display name is <WMDM PMSP Service>
Netsvc.exe availability:

Windows NT 4.0 - Supplement 4 of the Windows NT 4.0 Server Resource Kit.

Windows 2000    - Supplement One of the Windows 2000 Server Resource Kit.




Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish