Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


February 2008

Get Hotfix Information Quickly with WMIC

RSS
Subscribe to Windows IT Pro | See More Hotfixes Articles Here | Reprints
Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

Executive Summary:
Microsoft Windows Management Instrumentation (WMI) offers numerous classes and properties that you can use to retrieve information about local and remote computers. The Windows Management Instrumentation Command-line (WMIC) utility brings that functionality to the command line. This article explores how you can use the Windows Management Instrumentation Command-line utility to retrieve the IDs of all the hotfixes installed on the local machine.


There are dozens of different ways to find the hotfixes installed on computers, but the fastest and simplest way is to use a widely available tool named Windows Management Instrumentation Command-line (WMIC). With WMIC, getting the IDs of all the hotfixes installed on the local system can be done with this short command

wmic qfe get Hotfixid

If you aren’t familiar with WMIC and want an even shorter command to remember, you can cut the command down to

wmic qfe

Besides displaying the IDs, this command displays other details (e.g., hotfix name, hotfix installation date) about the installed hotfixes, which can be helpful.

If you just need to determine whether a specific hotfix is installed, you can avoid searching through a long list of hotfixes by piping the wmic qfe command’s output through the Find command. For example, if you want to see whether hotfix 938194 is installed on the local machine, you can run the command

wmic qfe | find “938194”

Note that you need to enclose the search string (in this case, 938194) in quotes.

At this point, you might be wondering what qfe is. In WMIC, you use aliases such as qfe to specify the Windows Management Instrumentation (WMI) class you’re interested in retrieving information from. In WMIC, an alias is essentially a nickname. Just like it’s easier to remember people’s nicknames than their full names, it’s easier to remember classes’ aliases than their full names. Besides helping with familiarity, aliases reduce what you have to type on the command line and can help differentiate between classes with similar names.

Although WMIC assumes that you’re using aliases on the command line, you can use standard Windows Management Instrumentation (WMI) class paths instead. For example, qfe is the alias for WMI’s Win32_Quick- FixEngineering class, therefore

wmic qfe get Hotfixid

is equivalent to

wmic path win32_quickfixengineering get Hotfixid

The path keyword that precedes the name of the WMI class tells WMIC that the path to a WMI class follows. So, if you don’t know a particular WMIC alias for a WMI class, all you need to do is use the path keyword followed by the class’s name.

There are several reasons why I use WMIC for checking hotfixes. As I mentioned earlier, it’s fast. You can type the entire command in an open command-prompt window more quickly than you can navigate to most programs on the Windows Start menu. It’s simple because you don’t need to install special programs to perform the query for you. Equally important, you can use it with virtually any Windows OS. Although WMIC has been around only since Windows XP, you can use WMIC’s /node parameter to run the utility remotely against earlier Windows OSs, as long as those OSs are running WMI. For example, to check for hotfixes on a Windows NT 4.0 system named LegacyHost that has the NT 4.0 WMI extensions installed, you’d run the command

wmic /node:legacyhost qfe get Hotfixid

There’s another reason to use WMIC for getting hotfix information. If you don’t already use WMIC, it gives you an opportunity to become familiar it, which has an immense long-term payoff: One tool is all you’ll need to find out information about any WMI property on any system you’re connected to. All you need to know is the property’s name and the appropriate alias. For example, if you want the names of all the printers on the local system, you’d use the printer alias with the Name property in the command

wmic printer get Name

Need the CPU speed on the local machine? Simply run

wmic cpu get CurrentClockSpeed

The built-in aliases that are available for use can differ depending on the OS you’re using. For example, if you need to find the memory currently installed on a Windows XP computer, you’d need to use

wmic memlogical get totalphysicalmemory

But on a Windows Server 2008, Windows Vista, or Windows Server 2003 machine, the command would be

wmic memorychip get Capacity

On the Windows IT Pro Web site, you can download a Microsoft Excel spreadsheet that shows the differences between WMIC aliases on various OS versions. Go to www.windowsitpro.com/Windows/Article/ArticleID/97781/97781.html and click the Download the Code Here button near the top of the page. The 97781.zip file that you download will contain the spreadsheet.

For more detailed information about WMIC’s options, you can check the built-in Help feature with one of the following commands:

wmic /?
wmic /?:full

Spending a little time learning about these options will pay off later when you need quick access to particular information about the systems you support.

End of Article



Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
The Memory-Optimization Hoax

Don't believe the hype. At best, RAM optimizers have no effect. At worst, they seriously degrade performance. ...

VMware and the Future of Virtualization

What's next for virtualization and business IT? Windows IT Pro senior editor Jeff James speaks with VMware President and CEO Diane Greene on the future of virtualization technology. ...

Common .pst File Questions

Sue Mosher addresses some of the inevitable questions that Outlook users eventually ask about Personal Folders (.pst) files. ...


Related Articles Rem: Disabling System Restore

Rem: Retrieving a Computer’s Manufacturing Information

What is the Windows Management Instrumentation Command-line (WMIC)?

WMIC

Windows OSs Whitepapers Replay for Exchange: Enterprise Protection and an Affordable Price

Are You Satisfied?

A Preliminary Look at Deployment Plans for Microsoft Windows Vista

Related Events Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Disaster Recovery and Backup

A Guide to Windows Certification and Public Keys

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

Critical Challenges of ESI & Email Retention
Are you storing too much electronic information? Get expert legal advice and better understanding of what you are required to do as an IT professional.

Become a fan of Windows IT Pro on Facebook!
Join us on Facebook and be a fan of Windows IT Pro!

Sustainable Compliance: Are You Having a Resource Crisis?
Read this white paper to examine trends in compliance and security management and review approaches to reducing the cost and operational burden of compliance.

Rev Up Your IT Know-How with Our Recharged Magazine!
The improved Windows IT Pro provides trusted IT content with an enhanced new look and functionality! Get comprehensive coverage of industry topics, expert advice, and real-world solutions—PLUS access to over 10,000 articles online. Order today!

Get It All with Windows IT Pro VIP
Stock your IT toolbox with every solution ever printed in Windows IT Pro and SQL Server Magazine plus bonus Web-exclusive content on hot topics. Subscribe to receive the VIP CD and a subscription to your choice of Windows IT Pro or SQL Server Magazine!



Order Your Fundamentals CD Today!
Gain an introduction to Exchange, learn server security requirements, and understand how unified communications can play a role in your messaging strategies with this free Exchange CD.
Windows IT Pro Home Register About Us Affiliates / Licensing Media Kit Contact Us/Customer Service  
SQL Connected Home IT Library SuperSite FAQ Wininfo News
Europe Edition Office & SharePoint Pro Windows Dev Pro Windows Excavator 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing