Documentation ¶
Overview ¶
Package wmi provides an interface to WMI. (Windows Management Instrumentation)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallMethod ¶
CallMethod usage: wmi.CallMethod("Win32_Process", "Create", "cmd /C notepad.exe", "C:\\Windows\\System32", objStartupConfig, &pid)
CallMethod calls a method named methodName on an instance of the class named className, with the given params.
CallMethod is a wrapper around DefaultClient.CallMethod.
func Query ¶
Query usage: wmi.Query("SELECT Name, HandleCount FROM Win32_Process", &res)
var res []struct { Name string HandleCount uint32 }
Query runs the WQL query and appends the values to dst.
dst must have type *[]S or *[]*S, for some struct type S. Fields selected in the query must have the same name in dst. Supported types are all signed and unsigned integers, time.Time, string, bool, or a pointer to one of those. Array types are not supported.
By default, the local machine and default namespace are used. These can be changed using connectServerArgs. See https://docs.microsoft.com/en-us/windows/desktop/WmiSdk/swbemlocator-connectserver for details.
Query is a wrapper around DefaultClient.Query.
Types ¶
This section is empty.