I will try to find a full running process path by PID in Windows using Golang.
So far found this library: https://github.com/mitchellh/go-ps to enum process lists.
p, err := ps.Processes()
if err != nil {
//t.Fatalf("err: %s", err)
}
if len(p) <= 0 {
//t.Fatal("should have processes")
}
found := false
for _, p1 := range p {
if p1.Executable() == "go" || p1.Executable() == "go.exe" {
found = true
break
}
}
for example, want to find the process with PID 2342
running from C:\Windows\Notepad.exe