luisperezphd / RunAsService

RunAsService is a command line tool that allows you to setup a regular console application to run as a service.

Home Page:http://runasservice.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[PENDING] Passing arguments

sergeevabc opened this issue · comments

Dear Luis, I am confused as the following sequence does not work.

$ RunAsService install "WatchExec" "C:\Test\watchexec.exe --postpone -w C:\FolderToWatch C:\Test\FileToLaunchOnChange.bat"

You must specify the path to a console application executable. Nothing in the parameters you specified pointed to an executable.

Dear Luis, I am confused as the following sequence does not work.

$ RunAsService install "WatchExec" "C:\Test\watchexec.exe --postpone -w C:\FolderToWatch C:\Test\FileToLaunchOnChange.bat"

You must specify the path to a console application executable. Nothing in the parameters you specified pointed to an executable.

That's Windows' fault. Try to put an extra quotation marks around the path of your executable+arguments. I never had any problem passing arguments so far.

@Jacosci I have doubts your solution helps ... When I tried to cure my problem (issue 3) by adding another "level" of quotes around the executable path I get an error saying in principle "I cant find an exe file-name in the string you give me" - when I remove the extra quotes the path is accepted (though it doesnt work if the path contains space(s) )