Partilhar via


Sc getkeyname

 

Applies To: Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2003 with SP2, Windows Server 2003 R2, Windows Server 2008 R2, Windows Server 2012, Windows Server 2003 with SP1, Windows 8

Gets the key name associated with a particular service, using the display name as input.

For examples of how to use this command, see Examples.

Syntax

sc [<ServerName>] getkeyname [<ServiceDisplayName>] [<BufferSize>]

Parameters

Parameter

Description

<ServerName>

Specifies the name of the remote server on which the service is located. The name must use the Universal Naming Convention (UNC) format (for example, \\myserver). To run SC.exe locally, omit this parameter.

<ServiceDisplayName>

Specifies the display name of the service.

<BufferSize>

Specifies the size (in bytes) of the buffer. The default buffer size is 1,024 bytes.

/?

Displays help at the command prompt.

Remarks

  • If ServiceDisplayName contains spaces, enclose the text in quotation marks (for example, "internet connection sharing").

  • ServiceDisplayName is not case-sensitive.

Examples

To get the key name associated with the service whose display name is "Remote Procedure Call (RPC)," type:

sc getkeyname "remote procedure call (rpc)"

To get the key name associated with the service whose display name is "Internet Connection Sharing (ICS)," type:

sc getkeyname "internet connection sharing"

To get the key name associated with the service whose display name is "Clipbook," type:

sc getkeyname clipbook

Additional references

Command-Line Syntax Key