- 1 year ago
How to use environment variable into winsw xml configuration?
Comment
1 / 1
To use an environment variable in a winsw XML configuration, you can use the ${env.<variable_name>}
syntax. Here's an example:
xml<service>
<id>MyService</id>
<name>My Service</name>
<description>This is my service.</description>
<executable>${env.SYSTEMROOT}\System32\notepad.exe</executable>
<log mode="rotate"/>
</service>
In this example, the executable
element uses the SYSTEMROOT
environment variable to locate the notepad.exe
executable. You can replace SYSTEMROOT
with the name of the environment variable you want to use.