Here is a Powershell script : List_Installed_Applications.ps1
$outputFile = "$env:APPDATA\Installed_Applications.txt"
$OS_Architecture = $env:PROCESSOR_ARCHITECTURE
if($OS_Architecture -eq 'x86')
{
#write-host '32-bit'
$key = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*"
}
else
{
#write-host '64-bit'
$key = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
}
Get-ItemProperty $Key |
Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
Format-Table –AutoSize |
Out-File $outputFile -Encoding UTF8 -Force
#Write-Host '-----------------------------------------------------------------------------------'
get-package | Format-Table -AutoSize | Out-File -Append $outputFile -Encoding UTF8 -Force #| Out-String -Width 200
Start-Process $outputFile
Here is another code but in Vbscript : List_Installed_Applications.vbs
Title = "List All Installed Software"
Call ForceCScriptExecution(Title)
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
Info = Info & "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
Info = Info & VbCrLf & "Display Name : " & strValue1
End If
objReg.GetStringValue HKLM, strKey & strSubkey,strEntry2, strValue2
If strValue2 <> "" Then
Info = Info & " | Install Date : " & strValue2
End If
objReg.GetDWORDValue HKLM, strKey & strSubkey,strEntry3, intValue3
objReg.GetDWORDValue HKLM, strKey & strSubkey,strEntry4, intValue4
If intValue3 <> "" Then
Info = Info & " | Version: " & intValue3 & "." & intValue4
End If
objReg.GetDWORDValue HKLM, strKey & strSubkey,strEntry5, intValue5
If intValue5 <> "" Then
Info = Info & " | Size : " & Round(intValue5/1024, 3) & " MB"
End If
Next
wscript.echo Info
wscript.sleep 5000
MsgBox "OK ALL is Done !",vbInformation,Title
'---------------------------------------------------------------
Sub ForceCScriptExecution(Title)
Dim Arg, Str, cmd
cmd = "CMD /C Title "& Title &" & "
If Not LCase( Right( WScript.FullName, 12 ) ) = "\cscript.exe" Then
For Each Arg In WScript.Arguments
If InStr( Arg, " " ) Then Arg = """" & Arg & """"
Str = Str & " " & Arg
Next
CreateObject( "WScript.Shell" ).Run _
cmd & "cscript //nologo """ & _
WScript.ScriptFullName & _
""" " & Str
WScript.Quit
End If
End Sub
'---------------------------------------------------------------