The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


Q&A: How do I Change the Name of my Windows Service?

How do I Change the Name of my Windows Service
  We manage a third-party package that installs a Windows Service with a generic name. I keep having to explain what it means to my team/customers, which can be a pain. How do I change the name of the service to include our company name?

— Garth P

Hi Garth.

A service actually has two names — the “Service Name” and the “Display Name”.

Both names are prominently displayed in the Services utility:

Windows Service Names

The Service Name

The Service Name is the unique identifier of the service. As a result, no two services can have the same Service Name (even with differing case).

And Windows restricts the Service Name in a couple other ways too, specifically:

  1. Its maximum length is 256 characters.

  2. Forward-slash (/) and back-slash (\) characters are not permitted.

So the Service Name is the “real” name of the Windows Service.

All command line programs — including the built-in NET and SC utilities — will accept the Service Name as an identifier of the service. And the Service Name identifies the service in the Windows Registry (in < HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services).

However, because Service Names are used in command line operations, they tend to be terse, technical and downright cryptic. To illustrate, here the Service Names of five important services installed on Windows 10:

  1. wuauserv

  2. W32Time

  3. ProfSvc

  4. Wlansvc

  5. lmhosts

Only the Windows OS geeks among us will be able to guess what those services do! 🙂

The Display Name

To counteract the caginess of the Service Name, the Display Name records a “friendlier” value, mainly for user interface programs to identify the service. For example, here are the corresponding Display Names of the services listed above:

  1. Windows Update

  2. Windows Time

  3. User Profile Service

  4. WLAN AutoConfig

  5. TCP/IP NetBIOS Helper

More meaningful, right? When picking from a list, it’s almost always better to show the Display Name instead of the Service Name. That’s what the Services utility does.

Note that the length of the Display Name is also limited to 256 characters but all characters (including forward-slash and back-slash) are allowed.

And perhaps surprisingly, there is no issue with two services having the same Display Name. However, that can be troublesome for lists that rely on Display Name, as we see here with Services:

Two service with the same Display Name

So which name would you like to change? The Service Name or the Display Name? Or both?

How to change the Service Name

Unfortunately Microsoft has not provided a great way (i.e. an API) for changing the Service Name. No operating system tools will allow you to change that value — not SC, Services or any other application.

However it is possible to adjust the Service Name — provided that you don’t mind working with the Windows Registry.

To change the Service Name:

  1. Open the Registry Editor.

    To do so, press the Windows + R keys to open the Run window, and then type regedit.

  2. On the left, navigate to the section where Windows Services are recorded:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

    Open the Services key to reveal all the services installed on your computer. The list is sorted alphabetically by Service Name:

    Registry Editor: Services key
  3. Find and highlight your service in the list.

  4. Right-click the entry and choose Rename:

    Registry Editor: Rename the service
  5. Enter the new name. Remember: limit the length to 256 characters; forward-slashes and back-slashes are not allowed.

  6. Reboot your computer. The new Service Name will not take effect until Windows restarts.

How to change the Display Name

Here are a three ways to change a service’s Display Name.

1. Using the SC command

Run this command from an elevated command prompt:

sc config <SERVICE-NAME> DisplayName= "Your new display name"

For example, we have updated the Display Name of the Spooler service:

Spooler service Display name updated

2. With PowerShell Set-Service

If you prefer PowerShell, the Set-Service cmdlet will do the trick:

Set-Service -Name <SERVICE-NAME> -DisplayName "Your new display name"

As you can see, PowerShell works just as smoothly as SC:

Spooler service Display name updated with PowerShell

However, be sure to run from a PS prompt with administrative rights, to avoid the dreaded “access denied” error.

3. Updating the service’s registry key

Finally, you can roll up your sleeves and modify the registry value directly.

DisplayName is a REG_SZ (string) value contained in the service’s registry key:

Registry: Spooler service Display Name

Double-click the “DisplayName” to set a new value:

Edit DisplayName

The new value will take effect after a reboot.

Best of luck with your customers!

Posted in Windows Services | Tagged , , , , , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *