tazdev Posted June 29, 2005 Share Posted June 29, 2005 This will do a quick and dirty software inventory on the PC you run it on. It basically searches the registry's uninstall section and reports all the stuff there. Exports it to at Text file on the root of c: named after the PC's name-programs.txt (Thanks Larry) expandcollapse popup#cs Routine to get a listing of all the software uninstallable from Add/Remove Programs It works well as an inventory of sorts for the PC Exports it to a text file on the root of C:\ named after the PC you are on. Tazdev 06-28-05 tazdev@gmail.com Version 1.00 #ce $ver = "1.00" $y = 1 $k = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $fn = ("c:\" & @ComputerName & "-programs.txt") If FileExists( $fn ) then FileDelete( $fn ) EndIf $f = FileOpen( $fn, 1) ; Check if file opened for writing OK If $f = -1 Then Exit EndIf Do $a = RegEnumKey($k, $y);gets the key $as = Stringleft($a, 1) $sv = RegRead($k & "\" & $a, "DisplayVersion") $sn = RegRead($k & "\" & $a , "DisplayName") If $as = "{" then $y = $y + 1 $a2 = ($sn & " - " & $sv) FileWrite($f, $y & " - App: " & $a2 & @CRLF) Else If $a = "" Then FileWrite($f, @CRLF) $y = $y + 1 Else FileWrite($f, $y & " - App: " & $a & " - " & $sv & @CRLF) $y = $y + 1 EndIf EndIf Until $a = "" FileClose($f) Link to comment Share on other sites More sharing options...
jcorr1339 Posted July 3, 2005 Share Posted July 3, 2005 This will do a quick and dirty software inventory on the PC you run it on. It basically searches the registry's uninstall section and reports all the stuff there. Exports it to at Text file on the root of c: named after the PC's name-programs.txt(Thanks Larry)Sweet I was just wanting to learn how to do something like this. I will give it a go.Thanks, Link to comment Share on other sites More sharing options...
busysignal Posted July 5, 2005 Share Posted July 5, 2005 tazdev, nice simple script. Work perfectly.. Cheers.. Link to comment Share on other sites More sharing options...
w0uter Posted July 5, 2005 Share Posted July 5, 2005 nice. 8 - App: AutoItv3 - 9 - App: AutoItv3beta - My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
sksbir Posted November 30, 2005 Share Posted November 30, 2005 (edited) A more effective method consists in using WSH scripting ,loading WindowsInstaller.Installer object. My working scripts : ( save it as yourscript.vbs ) It needs a argument : the file name in witch you want to store installation informations. expandcollapse popupConst cReadOnly = 0 Const cForWriting = 2 Const cPID_WORDCOUNT = 15 Const cHKEY_CLASSES_ROOT = &H80000000 Const iProdLen = 28 const SEP=";" '------------------------------------ ' Network object '------------------------------------ Set WshNetwork = Wscript.CreateObject("Wscript.Network") On Error resume next Set fso = CreateObject("Scripting.FileSystemObject") set FICLOG = fso.OpenTextFile(WScript.Arguments(0),2,True) Set msi = CreateObject("WindowsInstaller.Installer") If Err.Number = 0 Then '------------------------------------ ' File writing object '------------------------------------ Set fso = CreateObject("Scripting.FileSystemObject") set FICLOG = fso.OpenTextFile(WScript.Arguments(0),2,True) 'Write computername to output string FICLOG.Writeline "# PC name : " & Wshnetwork.computername FICLOG.Writeline "# installer Version : " & msi.version 'Iterate through all installed PRODUCTS based on Windows Installer For Each prod In msi.Products 'Gather information from ProductInfo ' LIGNE=msi.ProductInfo(prod, "ProductName") & SEP LIGNE = LIGNE & msi.ProductInfo(prod, "PackageName") & SEP LIGNE = LIGNE & msi.ProductInfo(prod, "VersionString") & SEP LIGNE = LIGNE & msi.ProductInfo(prod, "InstallSource") & SEP LIGNE = LIGNE & msi.ProductInfo(prod, "LocalPackage") & SEP ' Per User / Par Computer If msi.ProductInfo(prod, "AssignmentType") = "0" Then LIGNE = LIGNE & "PU" & SEP Else LIGNE = LIGNE & "PC" & SEP End If LIGNE = LIGNE & msi.ProductInfo(prod, "PackageCode") & SEP FICLOG.writeline LIGNE Next else FICLOG.writeline "# Error activating windowsinstaller" End If FICLOG.writeline "# END" 'Clean up objects Set msi = Nothing FICLOG.Close then call the WSH script from autoit like this: $MSIFILEINST=@TempDir & "MSINST_" & @ComputerName & ".txt" $RETCOD=RunWait ( "wscript.exe yourscript.vbs " & $MSIFILEINST) $FILEDESC=fileopen ( $MSIFILEINST,0) ; reread file ... etc.... Edited November 30, 2005 by sksbir Link to comment Share on other sites More sharing options...
Xenobiologist Posted November 30, 2005 Share Posted November 30, 2005 Hi,very nice. Similar to this : Installed SoftwareSo long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Gene Posted December 1, 2005 Share Posted December 1, 2005 Hi,very nice. Similar to this : Installed SoftwareSo long,MegaCheck this one.Another Installed Software [font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right... Link to comment Share on other sites More sharing options...
sksbir Posted December 1, 2005 Share Posted December 1, 2005 Hi,very nice. Similar to this : Installed SoftwareSo long,Meganot similar : scripts from this thread use registry : the advantage is that you don't need any resource out from autoit.The drawback is that this scripts don't care about programs wich are installed with a per user strategy. You have to check in HKCU too if you want a full inventory.Check this one.Another Installed Software@gene : this is the same thread... Link to comment Share on other sites More sharing options...
Gene Posted December 1, 2005 Share Posted December 1, 2005 not similar : scripts from this thread use registry : the advantage is that you don't need any resource out from autoit.The drawback is that this scripts don't care about programs wich are installed with a per user strategy. You have to check in HKCU too if you want a full inventory.@gene : this is the same thread... :"> Wry/sheepish grin, It wuz late, sorry.Gene [font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now