Relative paths for telegraf config file [Windows environment]

Hey,

Is there is a way to specify relative paths when trying to install telegraf as a service in the windows environment?

Currently I am using the below command:
telegraf.exe --service install --config .\telegraf.conf --config-directory .\telegraf.d

**Config file and telegraf.d are in the same directory as the telegraf.exe

Telegraf installation as a service is successful, but when starting the service, below error is :
telegraf] Error running agent: Error loading …\telegraf.conf, open …\telegraf.conf: The system cannot find the file specified.

Thanks for the help :slight_smile:

When you run a service it’s startup folder is “%WinDir%\System32”, that’s where “Service Control Manager” is located.

That’s why you should use absolute paths when passing file location as arguments.

2 Likes

Thank you, this helps :slight_smile: