Debugging Windows Services

16/10/2018 Stuart Moore   ID: 343886

How to debug a Windows Service (which is not a driver...):

Open up RegEdit

And create the following, substituting the name of the executable in the registry key for the executable the Service is running

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msiexec.exe]
"debugger"="\"C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\cdb.exe\" -server tcp:port=7123"

Now run the service (in this case, any MSI)

Open an administrator console and enter the following command, replace machine-xps2 with the name of the server you are attaching the debugger to:

C:\"C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\windbg.exe" -remote tcp:port=7123,Server=machine-xps2
Source:
Was this article helpful?

Table of Contents

    Can't find what you're looking for?

    Contact Support