title: Execute a vbscript in Go
body: <p>I am trying to have a Go program execute a vbscript that adds several registry values. The Go code that handles this is as follows:</p>
  
  <pre><code>err = exec.Command("cmd.exe", "/c", "registry.vbs").Run()
  if err != nil {
      fmt.Printf("Error: %s\n", err.Error())
  }
  </code></pre>
  
  <p>When I run my Go program and it gets to the part where it executes this vbscript absolutely nothing happens. The registry values are not changed and there are no errors. If I try to run the following command it works just fine:</p>
  
  <pre><code>cmd.exe /c C:\path\to\file\registry.vbs
  </code></pre>
  
  <p>Things I have tried:</p>
  
  <ul>
  <li>Add file path in the Go program</li>
  <li>Run the Go program as an administrator</li>
  <li>I tried using <code>.Output()</code> instead of <code>.Run()</code> and that resulted in the output equal to <code>[ ]</code></li>
  </ul>
  
  <p>Does anybody have any idea why this is happening?</p>
  
  <p>Any direction would be greatly appreciated.</p>