Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8458413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:04:26+00:00 2026-06-10T13:04:26+00:00

I want to fetch Windows Hotfix listing with some format, whose output can be

  • 0

I want to fetch Windows Hotfix listing with some format, whose output can be separated with some delimiter. so far I found a wmic command which gives me a desired output but the problem is the \s delimiter is not going to work here. Is there a way I can place some , or anyother character, which I can later use in java program to get individual columns?

Command

wmic qfe get caption,csname,description,hotfixid,installedby,installedon

Output

Caption                                        CSName    Description      HotFixID   InstalledBy          InstalledOn
http://go.microsoft.com/fwlink/?LinkId=161784  Abhishek  Update           KB971033   NT AUTHORITY\SYSTEM  3/15/2012
http://support.microsoft.com/?kbid=2032276     Abhishek  Security Update  KB2032276  NT AUTHORITY\SYSTEM  3/15/2012
..
.

Update

I am trying

for /f "tokens=1,2,3,4,5,6,7,8,9,10,11" %g in ('wmic qfe get caption,csname,description,fixcomments,hotfixid,installdate,installedby,installedon,name,servicepackineffect,status') do @echo %g,%h,%i,%j,%k,%l,%m,%n,%o,%p

but it gives me invalid GET Expression

C:\Users\Abhishek\Desktop>for /f "tokens=1,2,3,4,5,6,7,8,9,10,11" %g in ('wmic qfe get caption,csname,description,fixcomments,hotfixid,installdate,installedby,installedon,name,servicepackineffect,status') do @echo %g,%h,%i,%j,%k,%l,%m,%n,%o,%p
Invalid GET Expression.

What is the problem here? This might solve the problem for me .

More Update

I even tried the below command but this too does not solve space problem

Command

for /f "tokens=1,2,3,4,5,6,7,8,9,10,11" %g in ('wmic qfe list') do @echo %g,%h,%i,%j,%k,%l,%m,%n,%o,%p

Output

Caption,CSName,Description,FixComments,HotFixID,InstallDate,InstalledBy,InstalledOn,Name,ServicePackInEffect
http://go.microsoft.com/fwlink/?LinkId=161784,Abhishek,Update,KB971033,NT,AUTHOR,,Y\SYSTEM,3/15/2012,
http://support.microsoft.com/?kbid=2281679,Abhishek,Security,Update,KB2281679,NT,AUTHORITY\SYSTEM,3/15/2012,
http://support.microsoft.com/?kbid=2284742,Abhishek,Update,KB2284742,NT,AUTHORIT,,SYSTEM,3/15/2012,
http://support.microsoft.com/?kbid=2286198,Abhishek,Security,Update,KB2286198,NT,AUTHORITY\SYSTEM,3/15/2012,
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:04:30+00:00Added an answer on June 10, 2026 at 1:04 pm

    As I can see in the result of wmic, columns are separated at least by 2 spaces.

    Caption                                        CSName    Description      HotFixID   InstalledBy          InstalledOn
    http://go.microsoft.com/fwlink/?LinkId=161784  Abhishek  Update           KB971033   NT AUTHORITY\SYSTEM  3/15/2012
    http://support.microsoft.com/?kbid=2032276     Abhishek  Security Update  KB2032276  NT AUTHORITY\SYSTEM  3/15/2012
    

    So this can be easily parsed in Java by splitting with the \s{2,} regular expression :

    String result = "...";
    for (String line : result.split("\n")) {
         System.out.println("-> " + line);
         for (String column : line.split("\\s{2,}")) {
             System.out.println("  => [" + column.trim() + "]");
         }
     }
    

    Outputs:

    -> Caption                                        CSName    Description      HotFixID   InstalledBy          InstalledOn
      => [Caption]
      => [CSName]
      => [Description]
      => [HotFixID]
      => [InstalledBy]
      => [InstalledOn]
    -> http://go.microsoft.com/fwlink/?LinkId=161784  Abhishek  Update           KB971033   NT AUTHORITY\SYSTEM  3/15/2012
      => [http://go.microsoft.com/fwlink/?LinkId=161784]
      => [Abhishek]
      => [Update]
      => [KB971033]
      => [NT AUTHORITY\SYSTEM]
      => [3/15/2012]
    -> http://support.microsoft.com/?kbid=2032276     Abhishek  Security Update  KB2032276  NT AUTHORITY\SYSTEM  3/15/2012
      => [http://support.microsoft.com/?kbid=2032276]
      => [Abhishek]
      => [Security Update]
      => [KB2032276]
      => [NT AUTHORITY\SYSTEM]
      => [3/15/2012]
    

    For the batch side, I cannot help you as I know really nothing about it 🙂

    Edit:
    Apparently there is a switch /format:csv for wmic that should generate a CSV that you could also easily parse in Java. I cannot get it to work on my machine, but it’s worth to be noticed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want fetch last record using hibernate criteria Can u help me?
i Want to fetch this data using json decode. Please Help.. So far i
Selenium HQ records some web navigation and can replay it from Firefox. I want
I want to fetch some content from a webserver using Net:HTTP, like this: url
In Windows shell you can fetch the contents of a file and copy it
want to fetch the value from dynamically created textfield with tag from NSMutableArray.... Txt_New_Estimated
I want to fetch the user groups and want to list them but I
I want to fetch the title from book table and the subject name from
I want to fetch products by Category id. Because the products have an attribute
I want to fetch the unmatching records from two table in SQL, the table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.