I have a requirement to launch an executable as a windows service with help of procrun.
I followed the below steps.
- Created a batch-file named
run.bat
, to create a service.
"C:\Program Files (x86)\Test\prunsrv.exe" //IS//Test --DisplayName="Test" --Startup=auto --Install="C:\Program Files (x86)\Test\prunsrv.exe" --StartMode=exe --StartImage="C:\Program Files (x86)\Test\batchSample.exe" --LogPath="C:\Program Files (x86)\Test\logs" --StdOutput=auto --StdError=auto
- Created a batch-file,
batchSample.bat
, to launch a URL:
start https://www.youtube.com/watch?v=q3pG6b3uI_E
- Converted the batch-file to an executable,
batchSample.exe
, and placed it inC:\Program Files (x86)\Test
. - Executed
run.bat
.
At this point the the windows service, Test
started without giving any error, but it did not execute the batchSample.exe
as used for --StartImage
.
Appreciate your help.