troubleshooting Question

Sort command for wmic used in a batch script

Avatar of samiam41
samiam41Flag for United States of America asked on
Windows OSWindows BatchWindows 10* Batchfiles
8 Comments1 Solution10 ViewsLast Modified:

Hey Experts.  Wasn't sure if this was even possible with a batch file so if the answer is no, that works for me.  If it can be done but with Powershell or other utility, great, but that isn't an option right now.

Essentially I have an in-house script that our helpdesk launches on the end-users PC that gathers various pieces of info when they are trouble-shooting an issue.  They review the details of the log file and decide how to proceed.  One piece of info captured relates to which Windows Updates are installed.

wmic qfe get hotfixid,installedon >> %logfile%

The output is great but I want the results sorted by the date the update was installed or by the HotFixID.  I wasn't sure what the format option would be for that.

HotFixID   InstalledOn
KB5004333  8/20/2021
KB4498523  7/30/2019
KB4503308  7/25/2019
KB4508433  7/30/2019
KB4509096  7/24/2019
KB4515383  9/12/2019
KB4516115  9/13/2019
KB4517245  11/18/2020

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros