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

  • Home
  • SEARCH
  • 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 381291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:04:17+00:00 2026-05-12T15:04:17+00:00

I have a script which finds specific installed software but I am having trouble

  • 0

I have a script which finds specific installed software but I am having trouble also getting the software’s version. For example, say I am getting a list of all Microsoft software installed. Here is what I have thus far:

echo software installed > software_list.txt
echo ================= >>software_list.txt
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall temp1.txt
find "Microsoft" temp1.txt| find "DisplayName" > temp2.txt
for /f "tokens=2,3 delims==" %%a in (temp2.txt) do (echo %%a >> software_list.txt)

start notepad "software_list.txt"

del temp1.txt temp2.txt

How can I also get the DisplayVersion from the reg export? If I replace DisplayName with DisplayVersion, nothing is even found. Or, is there another avenue I should be taking here?

  • 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-05-12T15:04:17+00:00Added an answer on May 12, 2026 at 3:04 pm

    Replacing DisplayName with DisplayVersion results in an empty output because of the way this line works:

    find "Microsoft" temp1.txt| find "DisplayName" > temp2.txt
    

    What this line does is it finds all lines in the temp2.txt file that contain both the Microsoft and DisplayName substrings (that is, it finds the products whose names contain Microsoft). The lines with DisplayVersion, in their turn, contain product version numbers and don’t contain the word Microsoft, which is why you get empty output.

    I can suggest a couple of alternative solutions that use WMI:

    1. Parse the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall subkeys using a script (VBScript, PowerShell etc) rather than a batch file, because scripting languages offer much better support for text manipulation. Here’s a VBScript example that outputs the names and versions of installed Microsoft products (products whose names contain Microsoft, to be more precise):

      On Error Resume Next
      
      Const strComputer = "."
      Const HKLM        = &H80000002
      Const strKeyPath  = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
      
      Dim oReg, arrSubKeys, strProduct, strDisplayName, strVersion
      
      Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 
           strComputer & "\root\default:StdRegProv")
      
      ' Enumerate the subkeys of the Uninstall key
      oReg.EnumKey HKLM, strKeyPath, arrSubKeys
      For Each strProduct In arrSubKeys
        ' Get the product's display name
        oReg.GetStringValue HKLM, strKeyPath & "\" & strProduct, "DisplayName", strDisplayName
        ' Process only products whose name contain 'Microsoft'
        If InStr(1, strDisplayName, "Microsoft", vbTextCompare) > 0 Then
          ' Get the product's display version
          oReg.GetStringValue HKLM, strKeyPath & "\" & strProduct, "DisplayVersion", strVersion
          WScript.Echo strDisplayName & vbTab & strVersion
        End If
      Next
      

      Usage:

      cscript //nologo productlist.vbs
      cscript //nologo productlist.vbs > productlist.txt
    2. If the software you’re interested in is installed by the Windows Installer, you can get info about that software (such as the name, vendor, version etc) by querying the WMI Win32_Product class. The wmic utility lets you do this directly from the command line and batch files. Here’re some examples:

      • Print the names and versions of installed software:

        wmic product get Name, Version
        
      • List all installed Microsoft products:

        wmic product where "Vendor like '%Microsoft%'" get Name, Version
        
      • List installed products that have Office in their names:

        wmic product where "Name like '%Office%'" get Name, Version
        

      To save the wmic output to a file, you can use the /output and (optionally) /format parameters, e.g.:

      wmic /output:software.txt product get Name, Version
      wmic /output:software.htm product get Name, Version /format:htable
      

      For more information about the wmic syntax, see wmic /?

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

Sidebar

Ask A Question

Stats

  • Questions 209k
  • Answers 209k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you use "od -c" on the two binaries, and… May 12, 2026 at 9:42 pm
  • Editorial Team
    Editorial Team added an answer There are several ways to do this, depending on what… May 12, 2026 at 9:42 pm
  • Editorial Team
    Editorial Team added an answer Your comment to Art's answer pretty much explains the problem.… May 12, 2026 at 9:42 pm

Related Questions

I have a cron job to run a Ruby script, which runs fine on
I am having trouble building a Python function that launches TkInter objects, with commands
Here's the scenario: I have a local git repository that mirrors the contents of
I am rewriting our company website in cakephp, and need to find a way
Is there a maximum number of times that a DLL can be registered and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.