THREAD and WMI?

May 20, 2008
11,538
103
Syracuse, NY, USA
Will WMIQUERY and/or @WMI work inside THREAD? I can't get either to work. And I've seen these (below, without the usual indication of the source of the error). That makes me wonder if WMI must be somehow initialized in a thread.

Code:
v:\> thread wmiquery . "Select Name from Win32_Process where ProcessId=%_pid"

Error : Failed to create instance of WbemStatusCodeText
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
WMIQUERY requires (a lot of) COM, which isn't initialized in THREAD.

It could be done, though it'll add more than 10x to the memory usage and processing time, which kind of makes THREAD pointless. And it's probably not useful to use a command like WMIQUERY with THREAD, given that the output will get mixed up with whatever else TCC is doing.
 

Similar threads