Answer the question
In order to leave comments, you need to log in
How to run another application in golang?
There are 2 applications.
How to just run file2.exe from file1.exe ?
Answer the question
In order to leave comments, you need to log in
https://golang.org/pkg/os/exec/
package main
import (
"bytes"
"fmt"
"os/exec"
)
func main() {
cmd := exec.Command("dir")
var buf bytes.Buffer
cmd.Stdout = &buf
err := cmd.Start()
if err != nil {
fmt.Printf("error: %v\n", err)
}
err = cmd.Wait()
fmt.Printf("Command finished with error: %v\n", err)
fmt.Printf("Command finished with output: %v\n", buf.String())
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question