github.com/ssdev-go/moby@v17.12.1-ce-rc2+incompatible/pkg/reexec/command_windows.go (about)

     1  // +build windows
     2  
     3  package reexec
     4  
     5  import (
     6  	"os/exec"
     7  )
     8  
     9  // Self returns the path to the current process's binary.
    10  // Uses os.Args[0].
    11  func Self() string {
    12  	return naiveSelf()
    13  }
    14  
    15  // Command returns *exec.Cmd which has Path as current binary.
    16  // For example if current binary is "docker.exe" at "C:\", then cmd.Path will
    17  // be set to "C:\docker.exe".
    18  func Command(args ...string) *exec.Cmd {
    19  	return &exec.Cmd{
    20  		Path: Self(),
    21  		Args: args,
    22  	}
    23  }