Jump to content

Enumerate WSH Installed Software into a List


Recommended Posts

Second Post Guys, bear with me!

EDIT:

Make sure you have the Dellfunctions.au3 in your include directory. (Use the Search Forums) - Disregard this portion it was actually not required. I apologize.

I want to populate the WSH Script to create a list item with 2 Colums,

The first to tell the client the name of the software, the second is the version number.

Also, at the bottom of the list, would be an input box and a Submit or Enter Button to submit the information to the respective computer to poll the inventory. This software is not a rip-off of someone elses code, but I thank them for posting it to this list. I modified it slightly, and want to take it to the next level.

I'm stumped!

EDIT

Attachment instead of code, thanks ronsrules!

test.au3

Edited by DJ VenGenCe
Link to comment
Share on other sites

  • Moderators

Make sure you have the Dellfunctions.au3 in your include directory. (Use the Search Forums)

As soon as I read this, I quit reading... You're asking for help, and don't provide all the tools for it yourself.

Suggestion is to add it as an attatchment... I'm sure you'll get more help that way.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I don't know anything about WHS or I'm not a programmer either but I have this function made with autoit that will give you the software installed and the version on the local system or remote system.

$ret = _InstalledSoftware() ; It give you information from the local system

$ret = _InstalledSoftware('ComputerName') ; It give you information of the remote system

;===============================================================================
; Function Name:   _InstalledSoftware()
;
; Description:   Return a two dimensional array with all software installed and
;                  version in your system or remote system.
;
; Syntax:         _InstalledSoftware ( [$s_RemoteComputer] )
;
; Parameter(s): $s_RemoteComputer = ComputerName on the network
;                
; Requirement(s):  External:   = None.
;                 Internal:   = None.
;
; Return Value(s): On Success: = Returns a two dimensional array with all software install, 
;                                version and sets @error to 0.
;                 On Failure: = Returns "" and sets @error to 1.
;
; Author(s):       Danny35d
;
; Note(s):       
;
; Example(s):
;   _InstalledSoftware("ComputerName") it will return a two dimensional array with all 
;                                       software installed and version from the remote computer.
;   _InstalledSoftware() it will return a two dimensional array with all software installed localy
;===============================================================================
Func _InstalledSoftware($s_RemoteComputer = '') 
    Local $Count = 1
        
    If $s_RemoteComputer <> '' Then
        If StringMid($s_RemoteComputer, 1, 1) <> '\' Or StringMid($s_RemoteComputer, 2, 1) <> '\' Or StringRight($s_RemoteComputer, 1) <> '\' Then
            $s_RemoteComputer = '\\' & StringReplace($s_RemoteComputer, '\', '') & '\'
        EndIf
    EndIf
    Local Const $regkey = $s_RemoteComputer & 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
    
    While 1
        $key = RegEnumKey ($regkey, $Count)
        If @error <> 0 then ExitLoop
        $key1 = RegRead ($regkey & '\' & $key, 'Displayname')
        $key1 = StringReplace ($key1, ' (remove only)', '')
        $key2 = RegRead($regkey & '\' & $key, 'Displayversion')
        If $key1 <> '' Then 
            If Not IsDeclared('avArray') Then Dim $avArray[1][1]
            ReDim $avArray[UBound($avArray) + 1][UBound($avArray) + 1]
            $avArray[0][0] = UBound($avArray) - 1
            $avArray[0][UBound($avArray) - 1] = $key1
            $avArray[1][UBound($avArray) - 1] = $key2
        EndIf
        $Count = $Count + 1
    WEnd
    If Not IsDeclared('avArray') Then
        SetError(1)
        Return('')
    Else
        SetError(0)
        Return($avArray)
    EndIf
EndFunc

It will return a two dimensional array which [0][0] will be the amout of sofwares [0][#] will be software and [1][#] will be the version.

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...