title: Execute nginx exe in folder with -s reload args Consul template Windows
body: <p>I am using Consul Template V0.19.0 <strong><em>for windows</em></strong>, for rendering nginx loadbalancing config.It is working as expected. </p>
  
  <p>Now I want the consul template, to execute the nginx exe in a folder with args (-s reload) as below:-</p>
  
  <p><strong>Case 1:</strong></p>
  
  <pre><code>template {
  source = "Template/template.ctmpl"
  destination = "F:\\IDE\\Visual Studio Collection\\Web Servers\\nginx-
  1.12.0\\nginx-1.12.0\\conf\\nginx.conf"
  command = "F:\\IDE\\Visual Studio Collection\\Web Servers\\nginx-
  1.12.0\\nginx-1.12.0\\nginx -s reload"
  command_timeout = "60s"
  }
  </code></pre>
  
  <p>But it throws error like, "failed to execute command "F:\IDE\Visual Studio Collection\Web Servers\nginx-1.12.0\nginx-1.12.0\nginx.exe" from "Template/template.ctmpl" => "F:\IDE\Visual Studio Collection\Web Servers\nginx-1.12.0\nginx-1.12.0\conf\nginx.conf": child: exec: "F:IDEVisual": file does not exist".</p>
  
  <p><strong>Case 2:-</strong>
  Currently I have achieved this by making the nginx as service (using nssm) and gave the command like,  </p>
  
  <pre><code>command = "powershell restart-service nginx" 
  </code></pre>
  
  <p>instead of giving the full path followed by "-s reload".</p>
  
  <p>But for this, have to make the nginx as a service using apps like nssm.</p>
  
  <p>May I know, is there any way to tell the command attribute in the consul template config to, "execute the nginx exe in folder like in the <strong>Case 1</strong>" ?</p>
  
  <p>Thanks.</p>