I've been trying to, instead of the values been written one after another, to put them all in an array, so I can later call them when needed.
I've been trying to do so, but it has been just a mess with nothing working.
Here is my working VBScript that makes a Software Inventory on the programs you have installed on your computer and then writes it down to a text file.
How can I put them into an array.
Like have an array for sAppName and another one for sAppVer
I've been trying to do so, but it has been just a mess with nothing working.
Here is my working VBScript that makes a Software Inventory on the programs you have installed on your computer and then writes it down to a text file.
How can I put them into an array.
Like have an array for sAppName and another one for sAppVer
Code:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(".\SoftInv02.txt")
Const HKCR = &H80000000
Const HKCU = &H80000001
Const HKLM = &H80000002
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
".\root\default:StdRegProv")
sUninstallPath= "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKLM, sUninstallPath, aSubkeys
On Error Resume Next
For Each sSubkey In aSubkeys
oReg.GetStringValue HKLM, sUninstallPath &"\" &_
sSubkey, "DisplayName", sAppName
oReg.GetStringValue HKLM, sUninstallPath &"\" &_
sSubkey, "DisplayVersion", sAppVer
objFile.Write(sAppName)
objFile.WriteLine(sAppVer)
Next