I think you can use Windows Management Instrumentation for doing such
query. In a nutshell, WMI is an OS instrumentation layer with which you
can interact with queries like
"Select * from Win32_LogicalDisk WHERE FreeSpace < 2000000"
It's pretty cool because you can access lots of machine's resources this
way (processes, I/O, etc.). WMI can also fire events that you can
subscribe (for example if memory comsuption is above certain threshold).
Check the System.Management.Instrumentation in MSDN and the WMI query
language reference in Technet.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.