Windows Enterprise Desktop

Sep 6 2016   11:58AM GMT

Discovering WMIC (WMI command-line)

Ed Tittel Ed Tittel Profile: Ed Tittel

Tags:

Rooting around for a good way to view current drive letter associations at the command line this weekend, I stumbled across command line access to the Windows Management Interface, aka WMI. Known as WMIC (the WMI command-line utility) it delivers access to and control over all kinds of Windows settings and information. Right now I’m still just discovering WMIC , and learning about what it can do and how to use it. Even so, I already know it’s well worth digging into. That goes doubleĀ for those who write command-line or PowerShell scripts, or Windows OS utility programs.

discovering wmic via diskinfo

Here’s a nice example that shows drive letters and their associated volume names at the command line.

Discovering WMIC via Drive Info at the Command Line

Working on test machines this weekend, I found myself facing another round of post Win10 install cleanups with holdouts in Windows.old. Having already blogged about this and knowing the drill, I booted into a Windows 10 UFD to root them out. That was when I found myself jumping to Google to refresh my memory on viewing current drive associations. In turn, this led me to WMIC through a Windows Club story entitled “List Drives Using Command Prompt & PowerShell in Windows 10.”

I like my example better than theirs because it shows volume name as well as drive letter. Together, that data lets me identify exactly which drive is which on my systems. This information didn’t come as easily as I might have wished, however. Even though there’s a ton of WMIC documentation available, there’s very little overview or “best use” discussion of this awesome utility. The best of what is around comes from Microsoft, as you might expect. I’ll recommend the “WMI Command Line Tools” section of the WMI Reference as a good place to start. The “Useful WMIC Queries” post to the Ask the Performance Team blog (2/17/2012) is also pretty helpful.

As for myself, I’m going to keep digging in and learning for some time yet. Count on further WMIC blog posts from me as I figure things out. Stay tuned: good stuff ahead!

3  Comments on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.
  • JeffHicks
    WMIC is the earliest ancestor to PowerShell. If you use PowerShell, which you should if you are an IT Pro, there's no need to go back to WMIC. You can access the same information, often with less effort and with even more formatting and output options.
    10 pointsBadges:
    report
  • Ed Tittel

    Dear Jeff:
    Thanks for the heads-up. I guess that means I should be using the Get-WMiObject cmdlet to access WMI data instead of running the WMI CLI directly? Do you know of any good documentation that explains the full set of roles, objects and attributes so that I can organize and present this to my readers? I am still struggling with how best to get my hands around what an admin can and should do in PowerShell (or at the command line). As I look through the cmdlet library I see some related stuff but not a lot, and perhaps I just don't get the way things are organized. Any ideas?

    Thanks again,

    --Ed--

    13,175 pointsBadges:
    report
  • Ed Tittel

    Thanks: I'm off and running figuring out how to use get-WmiObject. It's proving relatively easy, thanks to lots of existing cmdlets from places such as computerperformance.co.uk. Good stuff!

    --Ed--

    13,175 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: