Scr1ptW1zard Posted May 23, 2012 Share Posted May 23, 2012 crobertson,Are you looking to create a file containing the customer information contained in the variable (%destination%) and the list of installed applications?If so, perhaps this will work for you:@Echo offset destination=%date% - My Customertype nul>.\apps.txttype nul>.\sorted.txtfor /f "tokens=2,*" %%a in ('Reg Query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /S^|find " DisplayName"') do ( echo "%%b"|findstr /B /V /C:"Hotfix"|findstr /B /V /C:"Security Update"|findstr /B /V /C:"Update">>.\apps.txt)sort .\apps.txt /o .\sorted.txtecho %destination%>.\destination.txt>nul copy .\destination.txt+.\sorted.txt .\backup.txtIf this is not correct, please rephrase your question to explain exactly what you are looking for. Link to comment Share on other sites More sharing options...
gunsmokingman Posted May 23, 2012 Share Posted May 23, 2012 Here is a script that enumerates the unistall keys in the registry, it produces a text file.Save As ReadRegisteryInstallApps.vbsConst HKLM = &H80000002 Dim StrComputer :StrComputer = "." Dim Act :Set Act = CreateObject("WScript.Shell") Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject") Dim Key :Key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" Dim Reg :Set Reg = GetObject("winmgmts://" & StrComputer & _ "/root/default:StdRegProv") Dim Arr :Arr = Array( _ "DisplayName", "QuietDisplayName", "InstallDate", _ "VersionMajor", "VersionMinor","EstimatedSize")Dim Ts, TxtTxt = Act.SpecialFolders("Desktop") & "\InstallApplications.txt"Set Ts = Fso.CreateTextFile(Txt)Reg.EnumKey HKLM, Key, arrSubkeys Ts.WriteLine vbtab & "List Of Installed Applications" For Each strSubkey In arrSubkeys int1 = Reg.GetStringValue(HKLM, Key & strSubkey, Arr(0), str1) If int1 <> 0 Then Reg.GetStringValue HKLM, Key & strSubkey, Arr(1), str1 If Not IsNull(str1) Then Ts.WriteLine _ "----------------------------------------------------------------" & _ vbCrLf & "Item Name " & vbTab & str1 End If Reg.GetStringValue HKLM, Key & strSubkey, Arr(2), str2 If Not IsNull(str2) Then Ts.WriteLine "Install On " & vbTab & str2 End If Reg.GetDWORDValue HKLM, Key & strSubkey, Arr(3), str3 Reg.GetDWORDValue HKLM, Key & strSubkey, Arr(4), str4 If Not IsNull(str3) Then Ts.WriteLine "Version " & vbTab & str3 & "." & str4 End If Reg.GetDWORDValue HKLM, Key & strSubkey, Arr(5), str5 If Not IsNull(str5) Then Ts.WriteLine "File Size " & vbTab & Round(str5/1024, 3) & " MB" End If NextTs.Close'-> Open Text ReportAct.Run(Txt),1,True '-> Ask To Keep Or delete FileIf MsgBox("Would you like to keep this file?" & vbCrLf & _ Txt, 4132,"Yes To Keep, No To Delete File?") = 7 Then Fso.DeleteFile Txt,True End If Rename ReadRegisteryInstallApps.vbs.txt to ReadRegisteryInstallApps.vbs to make active.ReadRegisteryInstallApps.vbs.txt Link to comment Share on other sites More sharing options...
iamtheky Posted May 23, 2012 Share Posted May 23, 2012 (edited) Here's an autoit version with a listview. In the listview there is additional functionality to right click and uninstall a selection (additional snippets are credited in the source). This version also dumps a log.txt with all items in the uninstall key, as some of the other solutions do.InstalledSoftware.zip Edited May 23, 2012 by iamtheky Link to comment Share on other sites More sharing options...
CoffeeFiend Posted May 24, 2012 Share Posted May 24, 2012 Since we've moved on to "not batch" solutions, here's a couple PowerShell quickies:gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*|select DisplayName,DisplayVersion,Publisher,UninstallString|sort DisplayNameThis outputs all installed software (and version, publisher, uninstall string) at the console. If you want to save it as a HTML file, try:gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*|select DisplayName,DisplayVersion,Publisher,UninstallString|sort DisplayName|ConvertTo-Html|Out-File C:\some\path\somename.htmThat will generate the same list, format it as a HTML table, and save it to C:\some\path\somename.htm If you want the same list, but saved as a CSV file to open with Excel, try:gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*|select DisplayName,DisplayVersion,Publisher,UninstallString|sort DisplayName|ConvertTo-CSV -NoTypeInformation|Out-File C:\some\path\somename.csvNote that sometimes Excel needs a bit of help to open CSV files properly. It might think it's fixed width, so if it does then tell it it's comma separated and it'll open fine, with each property in a separate column. You could also have manipulated Excel directly using its COM interface (Excel.Application) to create a real Excel document, assuming Excel is installed.Finally, if you just want to see it graphically on your screen (using a gridview), try:gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*|select DisplayName,DisplayVersion,Publisher,UninstallString|sort DisplayName|ogvQuick, easy and flexible. Link to comment Share on other sites More sharing options...
iamtheky Posted May 24, 2012 Share Posted May 24, 2012 Thats badass fiend Link to comment Share on other sites More sharing options...
CoffeeFiend Posted May 24, 2012 Share Posted May 24, 2012 Thats badass fiendThanks! It's really not that impressive though. It's mainly a matter of having taken time to learn PowerShell (and VBScript a decade before, and batch another decade before that). It's different and it takes time but it really pays off to learn new tools. So much people just don't invest the time, even to learn their current tools decently. I would bet that half the people on this board who still do batch today never even pressed F7 at the console Yep, that's been there for over 20 years. 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