Created
July 16, 2014 11:52
-
-
Save stefanschneider/61fdd197e6f6c719296a to your computer and use it in GitHub Desktop.
This file contains 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 ( | |
"github.com/StackExchange/wmi" | |
"log" | |
) | |
type Win32_Process struct { | |
ProcessId uint32 | |
Name string | |
VirtualSize uint64 | |
CommandLine *string | |
} | |
func main() { | |
var dst []Win32_Process = make([]Win32_Process, 0, 0) | |
q := wmi.CreateQuery(&dst, "") | |
for { | |
err := wmi.Query(q, &dst) | |
if err != nil { | |
//log.Fatal(err) | |
log.Println(err) | |
} | |
} | |
for i, v := range dst { | |
println(i, v.ProcessId, v.Name, v.VirtualSize, *v.CommandLine) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment