开发者

Help creating a service, escaping binPath

开发者 https://www.devze.com 2023-02-26 03:57 出处:网络
I want to create a service and need to escape double quotes in the binPath. The path should be something like this: C:\\path_to\\service_executable.exe -i \"path_to_config_file.conf\"

I want to create a service and need to escape double quotes in the binPath. The path should be something like this: C:\path_to\service_executable.exe -i "path_to_config_file.conf"

Do I simply double up the double quotes? ie.

binPath= "C:\path_to\service_executable.exe -i ""c:\开发者_运维问答path_to\config_file.conf"""


What comes after the EXE path is considered start parameters (-i "c:\path_to\config_file.conf"). They are specified in a separate field.

If you use Services.msc you can add it in "Start parameters" edit box. If you use a MSI to install the service, you can use the "Arguments" column in ServiceInstall table.

0

精彩评论

暂无评论...
验证码 换一张
取 消