Configure the “Image File Execution” options. To do this, use one of the following methods:
Method 1: Use the Global Flags Editor (gflags.exe)
a. Start Windows Explorer.
b. Locate the gflags.exe file on your computer.
Note The gflags.exe file is typically located in the following directory: C:\Program Files\Debugging Tools for Windows.
c. Run the gflags.exe file to start the Global Flags Editor.
d. In the Image File Name text box, type the image name of the process that hosts the service that you want to debug. For example, if you want to debug a service that is hosted by a process that has MyService.exe as the image name, type MyService.exe.
e. Under Destination, click to select the Image File Options option.
f. Under Image Debugger Options, click to select the Debugger check box.
g. In the Debugger text box, type the full path of the debugger that you want to use. For example, if you want to use the WinDbg debugger to debug a service, you can type a full path that is similar to the following: C:\Program Files\Debugging Tools for Windows (x86)\windbg.exe
h. Click Apply, and then click OK to quit the Global Flags Editor.