HOWTO: Create Windows Service with parameter

  • Thread starter Thread starter Topper
  • Start date Start date
T

Topper

Hello.

How do i create my custom Windows Service that will run with parameter. For
example, "Path to execute" field will contains path like
"<fullPath>\MyService.exe /myParam".
What can i add to my CustomService class or its installer?

Anybody knows how?
 
Topper said:
Hello.

How do i create my custom Windows Service that will run with parameter.
For
example, "Path to execute" field will contains path like
"<fullPath>\MyService.exe /myParam".
What can i add to my CustomService class or its installer?

Anybody knows how?

You can always add code to your installer to update the ImagePath key under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\[serviceName]
to include whatever parameter you want to pass.

David
 
Back
Top