Skip to content

Instantly share code, notes, and snippets.

@swshan
Created May 31, 2017 05:31
Show Gist options
  • Save swshan/d1a897f6a4f108d5b85b9a8753f8161b to your computer and use it in GitHub Desktop.
Save swshan/d1a897f6a4f108d5b85b9a8753f8161b to your computer and use it in GitHub Desktop.
cmd.go
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