I am trying to get this code to work without errors. I works fine but gives "object required" error.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
<head>
<title>Check</title>
<HTA:APPLICATION
APPLICATIONNAME="Look"
SCROLL="yes"
SINGLEINSTANCE="yes"
>
</head>
<br />
<script language="VBScript">
Function Window_Onload
pink.innerHTML = "These are installed list"
End Function
GetAddRemove
Function GetAddRemove
Dim StrComputer
strComputer = "."
Dim bank
Set look = CreateObject ("Scripting.Dictionary")
look.add "Power DVD", "1"
look.add "Configuration Manager Client", "2"
look.add "Lexmark Software", "3"
look.add "Paperport Viewer", "5"
look.add "Microsoft >Net Framework ", "6"
look.add "Microsoft Silverlight", "7"
look.add "Microsoft Office Enterprise 2007", "8"
look.add "Mozilla Firefox", "9"
look.add "EA", "10"
look.add "Client", "11"
look.add "Java", "12"
look.add "Adobe Flash Player", "13"
look.add "web", "14"
look.add "E Client", "15"
look.add "ATI Display Driver", "16"
look.add "Windows XP Service Pack 3", "17"
Dim sVal, sVer Dim cnt, oReg, sBaseKey, eRC, aSubKeys
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "/root/default:StdRegProv")
sBaseKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
eRC = oReg.EnumKey(HKLM, sBaseKey, aSubKeys)
Dim sKey
Dim strhtml
For Each sKey In aSubKeys
oReg.GetStringValue HKLM, sBaseKey & sKey, "DisplayName", sVal
oReg.GetStringValue HKLM, sBaseKey & sKey, _
"DisplayVersion", sVer
If look.exists(sValue) Then
strhtml= strhtml & sVal & Space(10) & sVers & "<br/>"
End If
pink.innerHTML = strhtml
Next
End Function
</script>
<body>
<table><tr><td><input type="button" value="Check Programs" name="GETADD" onClick="GetAddRemove"
/></td></tr></table>
<p>
<span id = "pink"></span></p>
</body>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
<head>
<title>Check</title>
<HTA:APPLICATION
APPLICATIONNAME="Look"
SCROLL="yes"
SINGLEINSTANCE="yes"
>
</head>
<br />
<script language="VBScript">
Function Window_Onload
pink.innerHTML = "These are installed list"
End Function
GetAddRemove
Function GetAddRemove
Dim StrComputer
strComputer = "."
Dim bank
Set look = CreateObject ("Scripting.Dictionary")
look.add "Power DVD", "1"
look.add "Configuration Manager Client", "2"
look.add "Lexmark Software", "3"
look.add "Paperport Viewer", "5"
look.add "Microsoft >Net Framework ", "6"
look.add "Microsoft Silverlight", "7"
look.add "Microsoft Office Enterprise 2007", "8"
look.add "Mozilla Firefox", "9"
look.add "EA", "10"
look.add "Client", "11"
look.add "Java", "12"
look.add "Adobe Flash Player", "13"
look.add "web", "14"
look.add "E Client", "15"
look.add "ATI Display Driver", "16"
look.add "Windows XP Service Pack 3", "17"
Dim sVal, sVer Dim cnt, oReg, sBaseKey, eRC, aSubKeys
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "/root/default:StdRegProv")
sBaseKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
eRC = oReg.EnumKey(HKLM, sBaseKey, aSubKeys)
Dim sKey
Dim strhtml
For Each sKey In aSubKeys
oReg.GetStringValue HKLM, sBaseKey & sKey, "DisplayName", sVal
oReg.GetStringValue HKLM, sBaseKey & sKey, _
"DisplayVersion", sVer
If look.exists(sValue) Then
strhtml= strhtml & sVal & Space(10) & sVers & "<br/>"
End If
pink.innerHTML = strhtml
Next
End Function
</script>
<body>
<table><tr><td><input type="button" value="Check Programs" name="GETADD" onClick="GetAddRemove"
/></td></tr></table>
<p>
<span id = "pink"></span></p>
</body>