title: How can i execute sc create command through exec os/exec?
body: <p>How can i execute my <code>sc</code> command through <code>exec.Command</code>? </p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>cmd := exec.Command("cmd.exe", "sc", "create", "Simpler", "binpath="+os.Getenv("APPDATA")+"\\Simpler\\cc.exe", "displayname=MY SERVICE");
  cmd.SysProcAttr = &amp;syscall.SysProcAttr{HideWindow: true};
  out, _ := cmd.Output(); fmt.Println(string(out))
  </code></pre>
  
  <p>This i get in command prompt (open command prompt in current command prompt -_-): </p>
  
  <pre><code>Microsoft Windows [Version 6.3.9600]
  (c) 2013 Microsoft Corporation. All rights reserved.
  
  C:\WINDOWS\system32&gt;cd c:\prog\logs
  
  c:\prog\logs&gt;go build test.go
  
  c:\prog\logs&gt;test.exe
  Microsoft Windows [Version 6.3.9600]
  (c) 2013 Microsoft Corporation. All rights reserved.
  
  c:\prog\logs&gt;
  
  c:\prog\logs&gt;
  </code></pre>
  
  <p>Followed command cannot be executed. I do not get anything! Where is the problem?</p>
  
  <p>Command been started if i execute <code>sc.exe</code> in current command prompt but not started if i execute in new command prompt. </p>
  
  <p>That is if i remove first argument <code>"cmd.exe"</code> my program succesfully execute with excepted result. But how to execute in a new window?</p>