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.
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!