Query over the content of CIM repository on Windows Machines that uses WQL (Windows Management Instrumentation Query Language ).
Questions tagged [wmi-query]
545 questions
3
votes
1 answer
Select query of wmi used to view the process which has max usage of cpu
What is the query used to view the topmost process which is having maximum usage of CPU using WMI?

Developer404
- 5,716
- 16
- 64
- 102
3
votes
0 answers
WMI Query Output to variable
I'm trying to run some commands based on OS and x86 vs. x64. When running the below code the variable remains blank. I can echo the output and see the query and property seem to be correct. Any idea why that string isn't being assigned tot he…

David
- 31
- 1
3
votes
2 answers
C# .NET ManagementObjectSearcher Query
My C# .NET 2.0 application performs two queries using the ManagementObjectSearcher class:
_searcher = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM MSWmi_PnPInstanceNames");
_searcher = new ManagementObjectSearcher("root\\WMI", "SELECT *…

Jim Fell
- 13,750
- 36
- 127
- 202
3
votes
1 answer
Async WMI Query in Inno Setup
I'm trying to implement asynchronous WMI queries in my Inno Setup project. But I'm struggling with the event definitions. I'm getting a Type mismatcherror on the line
objSink.OnCompleted := @WMI_OnCompleted;
I am assuming that my event definition…

Marco Rebsamen
- 605
- 7
- 30
3
votes
2 answers
How to read WMI data of a USB (PnP) device, in this case the hardware ids, in C#?
How can I get the hardware id from an USB device? I know how to get that id with device-manager, but I want to get it via C#. Is that possible? This is what I´ve done already, but that delivers me not the hardware if which consists of the vendor id…

L4c0573
- 333
- 1
- 7
- 23
3
votes
1 answer
Can you return the Volume GUID of a disk with VBA?
I came across a another post VBA Open a USB device using it's unique id in wmi
that was unanswered where the poster showed a way to get a USB device UID via VBA and WMI but I am not sure how to retreive the VolumeGUIDs out of WMI with VBA.
I would…

Matt
- 483
- 1
- 4
- 22
3
votes
0 answers
Uninstall msi/service remotely with administrator rights
I have implemented code to uninstall a msi. The problem is, when I try to uninstall it remotely using WMI it doesnt get happen and even don't throw any exception. I tried on local and found that when I run command "MsiExec.exe /x {Product Code}…

Abb
- 3,051
- 3
- 17
- 34
3
votes
1 answer
"Status" return of a WMI feature is empty
I am converting a Installer Programm from VBS into a C# programm.
In this installation i have to activate some windows features with DISM.
"cmd.exe", "/C Dism /Online /Enable-Feature /FeatureName:WAS-ProcessModel"
I activated them in this way.…

TomK
- 33
- 5
3
votes
1 answer
Difference between ASSOCIATOR OF and ManagementObjectCollection method GetRelated
I've noticed that with WMI queries, ie WQL - SQL for WMI, that you can utilize Associators to access 2 classes in the same namespace like Msvm_VirtualSystemSettingData and Msvm_ResourceAllocationSettingData that are a part of…

cameracode
- 97
- 1
- 10
3
votes
1 answer
Enable/Disable of the network adapter through MSFT_NetAdapter
I'm trying disable/enable the network adapter through MSFT_NetAdapter in OS Windows 8.
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=Delegate," _
& "authenticationLevel=pktPrivacy}\root\standardcimv2")
Set…

Станислав Ра
- 31
- 4
3
votes
2 answers
Delete file on Remote Server Using WMI
I'm trying to delete an existing file on the remote server using WMI.
Here's my code:
string name = @"\\servername\\OCROut\\basketball.txt";
ConnectionOptions options = new ConnectionOptions(remoteServer, "username", "password",…

Arka
- 31
- 6
3
votes
2 answers
WMIprvse process leaks memory on 2008 server R2
I have a Windows 2008 R2 server running on a VM machine.
My .NET service is running on this server periodically querying WMI, for example:
SELECT ProcessId FROM Win32_Service WHERE ...
After a day or two WMIprvse takes up to 500M memory and WMI…

Dani Fischer
- 91
- 2
- 4
3
votes
1 answer
Trying to uniquely ID a USB device from WMI query using DeviceID field
When WMI is queried and returns a list of devices, I've noted some information at the END of the DeviceID string that isn't documented anywhere I've looked so far. Here's an example of a DeviceID string returned from a WMI query looking at…

Redgum
- 388
- 5
- 14
3
votes
3 answers
Getting RPM from HDD and if disk is SSD or not in vb.net
As the title says it, i am working in vb.net and trying to get the RPM of my hard disk in a textbox.
Next to that i am trying to figure out if my disk is a HDD or SSD.
I have been searching the web a full week now on anything i can think of and all…

Mr-HaXx
- 93
- 1
- 9
3
votes
1 answer
use wmi to get newest Windows log events
I want to use WMI to monitor the Windows event log and get newest log events every 15 minute. Although I can use WQL to do the query, it does not have the keywords such as order by. Any ideas how to work around this problem?

eric
- 31
- 2