none
VBscript to find specific list of installed software on windows XP, windows & and others RRS feed

  • Question

  • Hi All,

    I need a vbscript which will find following list of softwares on my system, and if it is there then it will give detials of that software like version, install date, etc.

    1.  IE details (like v10)
    2.  PAC File details which is use for internet browsing
    3. Java JRE details

    Also my concern is that it must run on all versions of windows OS from XP to 8.1

    As I am new to vb script so please help me out.

    Thanks.
    Sunday, June 8, 2014 12:40 PM

Answers

  • you leave it.... this question is for experts not for beginners.... (note the word "expert")
    • Marked as answer by Bunty Singh Thursday, July 3, 2014 3:28 PM
    • Edited by Bunty Singh Thursday, July 3, 2014 3:35 PM
    Thursday, July 3, 2014 3:28 PM

All replies

  • WMI Win32_Product. Look in the repository for numerous examples.


    ¯\_(ツ)_/¯

    Sunday, June 8, 2014 12:53 PM
  • i used following code and it gives all software installed but i need only above mentioned software

    Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE

    strComputer = "."

    strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"

    strEntry1a = "DisplayName"

    strEntry1b = "QuietDisplayName"

    strEntry2 = "InstallDate"

    strEntry3 = "VersionMajor"

    strEntry4 = "VersionMinor"

    strEntry5 = "EstimatedSize"

    Set objReg = GetObject("winmgmts://" & strComputer & _
     "/root/default:StdRegProv")

    objReg.EnumKey HKLM, strKey, arrSubkeys

    WScript.Echo "Installed Applications" & VbCrLf

    For Each strSubkey In arrSubkeys

      intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
       strEntry1a, strValue1)

      If intRet1 <> 0 Then
        objReg.GetStringValue HKLM, strKey & strSubkey, _
         strEntry1b, strValue1
      End If

      If strValue1 <> "" Then
        WScript.Echo VbCrLf & "Display Name: " & strValue1
      End If

      objReg.GetStringValue HKLM, strKey & strSubkey, _
       strEntry2, strValue2

      If strValue2 <> "" Then
        WScript.Echo "Install Date: " & strValue2
      End If

      objReg.GetDWORDValue HKLM, strKey & strSubkey, _
       strEntry3, intValue3

      objReg.GetDWORDValue HKLM, strKey & strSubkey, _
       strEntry4, intValue4

      If intValue3 <> "" Then
         WScript.Echo "Version: " & intValue3 & "." & intValue4
      End If

      objReg.GetDWORDValue HKLM, strKey & strSubkey, _
       strEntry5, intValue5

      If intValue5 <> "" Then
        WScript.Echo "Estimated Size: " & Round(intValue5/1024, 3) & " megabytes"
      End If

    Next

    Sunday, June 8, 2014 1:16 PM
  • You will have to write your own script to customize the results.

    Use PowerShell as it is easier to filter.


    ¯\_(ツ)_/¯

    Sunday, June 8, 2014 1:17 PM
  • Here is an example of how to do this in PowerShell:

    Get-WmiObject Win32_Product -filter 'Name LIKE "%office" OR Name LIKE "%Chrome%"'

    You can add as many "ORs" as you need.


    ¯\_(ツ)_/¯


    • Edited by jrv Sunday, June 8, 2014 1:25 PM
    Sunday, June 8, 2014 1:25 PM
  • i want to implement the above query in vb script only. As powershell is not possible in my environment.

    Please suggest solution in vbscript.

    Sunday, June 8, 2014 1:35 PM
  • Why is PowerShell not possible?  It is installed by default on all new versions of Windows.  PowerShell can use WMI to query any current version of Windows.

    You only other method is to learn to write scripts and to modify an existing script.


    ¯\_(ツ)_/¯

    Sunday, June 8, 2014 1:38 PM
  • One other choice is to use the software inventory scripts that output to a CSV. Load the CSV into Excel and filter it.


    ¯\_(ツ)_/¯

    Sunday, June 8, 2014 1:40 PM
  • I think my question is related to vbscript and not powershell.

    So, I am expecting help in vbscript only, if anyone can.

    Monday, June 16, 2014 3:44 PM
  • Why use VBScript when it is easier in PowerShell.  There is no reason to not use PowerShell.

    If you do it in VBScript you will have to write and debug a lot of code.


    ¯\_(ツ)_/¯

    Monday, June 16, 2014 3:55 PM
  • If you insist on VBScript then you need to place a large compound "if" statement or a switch statement in your script to filter the results.  There is no simple method.


    ¯\_(ツ)_/¯

    Monday, June 16, 2014 3:57 PM
  • Hi,

    I wrote a script a while back that only requires PowerShell on the computer from which you are running the script (remote computers do not have to have PowerShell installed):

    Windows IT Pro: Auditing 32-Bit and 64-Bit Applications with PowerShell

    Aside from this, I would note that this forum is for scripting questions, not script requests.


    -- Bill Stewart [Bill_Stewart]

    Monday, June 16, 2014 3:57 PM
    Moderator
  • I would also add that your question is rather vague.  Not all things are discoverable via WMI or the registry.  You need to spend sometime understanding what it is you are trying to discover.  If you can sort that out there may be easier ways to do what you need.


    ¯\_(ツ)_/¯

    Monday, June 16, 2014 4:01 PM
  • jrv is correct; looking back at your question, checking installed software isn't going to tell you what PAC file is in use or what IE version is installed. (It will tell you JRE version.)


    -- Bill Stewart [Bill_Stewart]

    Monday, June 16, 2014 4:02 PM
    Moderator
  • It is possible if vbscript writers can help but must work for win xp and win 7 & above OS.

    Plz don't suggest powershell option.

    Thursday, July 3, 2014 2:29 PM
  • It is possible if vbscript writers can help but must work for win xp and win 7 & above OS.

    Plz don't suggest powershell option.

    WMI Win32_product works for all of the above in VBScript. Look in the repository for numerous examples.


    ¯\_(ツ)_/¯

    • Proposed as answer by jrv Thursday, July 3, 2014 2:53 PM
    • Unproposed as answer by Bunty Singh Thursday, July 3, 2014 3:26 PM
    Thursday, July 3, 2014 2:35 PM
  • 1. The PowerShell script I wrote can retrieve installed software on remote computers. The only computer that requires PowerShell is the computer on which you are running the script. The remote computers do not require PowerShell.

    2. This forum is for scripting questions, not script requests.

    3. If you require a VBScript solution, you are going to have to write it. You can ask here if you have specific questions (note the word "specific").


    -- Bill Stewart [Bill_Stewart]

    • Proposed as answer by jrv Thursday, July 3, 2014 2:53 PM
    • Unproposed as answer by Bunty Singh Thursday, July 3, 2014 3:26 PM
    Thursday, July 3, 2014 2:37 PM
    Moderator
  • you leave it.... this question is for experts not for beginners.... (note the word "expert")
    • Marked as answer by Bunty Singh Thursday, July 3, 2014 3:28 PM
    • Edited by Bunty Singh Thursday, July 3, 2014 3:35 PM
    Thursday, July 3, 2014 3:28 PM
  • you leave it.... this question is for experts not for beginners.... (note the word "expert")

    You haven't asked a question, you've asked for someone to write you a script (which we don't do here).

    Let us know if you have any actual questions and we'll try to help you.


    Don't retire TechNet! - (Don't give up yet - 12,950+ strong and growing)

    Thursday, July 3, 2014 3:46 PM
  • you leave it.... this question is for experts not for beginners.... (note the word "expert")

    Sorry but we do not write custom scripts.  We can help be answering reasonable questions.  The forum is for technicians and not end users.  Perhaps you can contact a consultant to help you.


    ¯\_(ツ)_/¯

    Thursday, July 3, 2014 4:01 PM
  • There is a searchable script Repository (link at the top of the page) as well as a script request page available here:

    http://gallery.technet.microsoft.com/scriptcenter/site/requests


    -- Bill Stewart [Bill_Stewart]

    Thursday, July 3, 2014 4:11 PM
    Moderator