How can I change the name of a windows service?

前端 未结 3 598
慢半拍i
慢半拍i 2021-02-13 15:36

I have a windows service application developed in C#. The same service needs to be run with different config files. To run on these on the same machine I would need to change th

3条回答
  •  [愿得一人]
    2021-02-13 16:04

    The configuration for Windows services are stored in the Registy, under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services... You will probably want to change both the name of the key (the "folder", and the real name of the service here) and the value "Display Name".

    It might be better to use a tool like SC.EXE to configure services, to avoid causing problems with bad Registry edits. Although SC can't rename a service in place, it does allow you to delete and create services (just be sure to get all the settings right!).

提交回复
热议问题