# Relative paths for telegraf config file \[Windows environment\]

**URL:** <https://community.influxdata.com/t/relative-paths-for-telegraf-config-file-windows-environment/12631>\
**Category:** Systems\
**Tags:** telegraf\
**Created:** [January 15, 2020, 11:21pm UTC](https://community.influxdata.com/t/relative-paths-for-telegraf-config-file-windows-environment/12631 "2020-01-15T23:21:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anurag\_Arora](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anurag_arora/32/2955_2.png) [@Anurag\_Arora](https://community.influxdata.com/u/Anurag_Arora)\
**Post date:** [January 15, 2020, 11:21pm UTC](https://community.influxdata.com/t/relative-paths-for-telegraf-config-file-windows-environment/12631/1 "2020-01-15T23:21:10Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Giovanni\_Luisotto](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/giovanni_luisotto/32/4017_2.png) [@Giovanni\_Luisotto](https://community.influxdata.com/u/Giovanni_Luisotto)\
**Post date:** [January 16, 2020, 8:42am UTC](https://community.influxdata.com/t/relative-paths-for-telegraf-config-file-windows-environment/12631/2 "2020-01-16T08:42:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Anurag\_Arora](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anurag_arora/32/2955_2.png) [@Anurag\_Arora](https://community.influxdata.com/u/Anurag_Arora)\
**Post date:** [January 16, 2020, 8:10pm UTC](https://community.influxdata.com/t/relative-paths-for-telegraf-config-file-windows-environment/12631/3 "2020-01-16T20:10:44Z")

</div>

Thank you, this helps 🙂
