Helper method for executing cmd commands (does not open cmd window).
(cmd string, args ...string)
| 104 | |
| 105 | // Helper method for executing cmd commands (does not open cmd window). |
| 106 | func executeCommand(cmd string, args ...string) (string, error) { |
| 107 | var out []byte |
| 108 | command := exec.Command(cmd, args...) |
| 109 | command.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} |
| 110 | out, err := command.CombinedOutput() |
| 111 | |
| 112 | return string(out), err |
| 113 | } |
| 114 | |
| 115 | // checkStatus checks status of hardentools registry key |
| 116 | // (that tells if user environment is hardened / not hardened). |
no outgoing calls