Created
May 31, 2017 05:31
-
-
Save swshan/d1a897f6a4f108d5b85b9a8753f8161b to your computer and use it in GitHub Desktop.
cmd.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os/exec"; | |
"fmt"; | |
"bytes"; | |
) | |
func main() { | |
cmd := exec.Command("C:\\Windows\\System32\\sc.exe", "config", "lanmanworkstation", "depend=", " bowser/mrxsmb20/nsi") | |
cmd2 := exec.Command("C:\\Windows\\System32\\sc.exe", "config", "mrxsmb10", "start=", "disabled") | |
fmt.Println("then") | |
var out bytes.Buffer | |
var out2 bytes.Buffer | |
cmd.Stdout = &out | |
cmd2.Stdout = &out2 | |
cmd.Run() | |
cmd2.Run() | |
fmt.Println("point 2") | |
fmt.Println(out.String()) | |
fmt.Println(out2.String()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment