Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Strange HTA behaviour on newly restored WXP SP1

Reply
 
Old 03-12-2009   #1 (permalink)
Paul Randall


 
 

Strange HTA behaviour on newly restored WXP SP1

Hi,
I've bought a set of system restore disks for a Compaq desktop and done the
restore to a new hard drive. It installs WXP SP1 plus all the typical
crapware. After going through the initial bootup and setup stuff, I wanted
to get a list of installed software so I could methodically get rid of the
junk I didn't want. I downloaded the HTA at
http://www.microsoft.com/technet/scr.../cscsw044.mspx
and attempted to run it. All it does is display the HTA's source in an HTA
window. If I build a simple HTA, it displays only the <body> text just
fine. I've attached my two HTAs and appended them below.

I'm hoping someone can give me some insights to why this fresh new system
displays the tiny HTA correctly but displays the source file for the
ListInstalledSoftware HTA. In both cases I can see that mshta.exe is
started in windows task manager.

Since I will be deleting a lot of the junk currently installed, I don't
really want to upgrade IE to the latest version 6, to avoid confusion while
uninstalling the trial Office 2003 and the other junk.

Tiny HTA:
<html>
<head>
<title>Simple HTA</title>

<HTA:APPLICATION
ID="Simple"
APPLICATIONNAME="Simple HTA"
SCROLL="Yes"
ICON="ssi.ico"
SINGLEINSTANCE="no"
WINDOWSTATE="fixed"
Quote:

>
</head>
<body>
This is a simple HTA (HTML Application)
</body>
</html>

ListInstalledSoftware HTA:
<!--

** Simple Software Inventory **

2006/05/21

Written by Jarno Mäki / IT Education Center Finland

This HTA contacts your computer thru network and queries
all the installed software that can be found from the
registry.

Note that this HTA doesn't work if target computer's
firewall is enabled.

Available from Microsoft's ScriptCenter
http://www.microsoft.com/technet/scr.../cscsw044.mspx
-->
<html>
<head>
<title>Simple Software Inventory</title>

<HTA:APPLICATION
ID="objSSI"
APPLICATIONNAME="Simple Software Inventory"
SCROLL="Yes"
ICON="ssi.ico"
SINGLEINSTANCE="no"
WINDOWSTATE="fixed"
Quote:

>
</head>

<SCRIPT Language="VBScript">

Public strUser

Sub Window_onLoad

self.Focus()
self.ResizeTo 550,550
self.MoveTo 200,200

DataSpan.InnerHtml = "<em>Write the computer's name to the textbox you
want to audit.</em>"

End Sub


Sub GetSoftwareInventory()
On Error Resume Next

Const HKLM = &H80000002
strComputer = ComputerNameBox.Value
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")

If Err.Number <> 0 Then Call ErrorCheck(Err.Number, Err.Description)


objReg.EnumKey HKLM, strKey, arrSubkeys

For Each strSubkey In arrSubkeys

strIsReal = 0

intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
strEntry1a, strValue1)
If intRet1 <> 0 Then

objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry1b, strValue1
End If
If strValue1 <> "" Then
strIsReal = 1
strSoftat = strSoftat & "<b>" & strValue1 & "</b>" & " - "

End If
objReg.GetStringValue HKLM, strKey & strSubkey, _
strEntry2, strValue2
If strValue2 <> "" Then
strSoftat = strSoftat & "<font color=""#0000A0"">" & strValue2 &
"</font> - "

End If
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry3, intValue3
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry4, intValue4
If intValue3 <> "" Then
strSoftat = strSoftat & "<font color=""#008040"">" & intValue3 & "."
& intValue4 & "</font> - "

End If
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
strEntry5, intValue5
If intValue5 <> "" Then
strSoftat = strSoftat & "<font color=""#808000"">" &
Round(intValue5/1024, 3) & " megabytes </font><br>"

Else
if strIsReal = 1 then strSoftat = strSoftat & "<br>"

End If
Next

DataSpan.InnerHtml = strSoftat

End Sub


Sub ErrorCheck(sErrorCode, sErrorDescription)

Select Case sErrorCode

Case 462

MsgBox "Target computer is not found!" & vbCrLf & VbCrLf _
& "Check that target computer is online and" & vbCrLf _
& "it's local firewall is disabled.",64,"Computer not found"

Err.Clear

Case Else

MsgBox "Error occurred." & vbCrLf & VbCrLf _
& "Error code is:" & sErrorCode & vbCrLf _
& "Error description is: " & sErrorDescription,64,"Mystical
error occurred"

Err.Clear

End Select

End Sub


</SCRIPT>


<body bgcolor="#D4D0C8" topmargin="0" leftmargin="0"
style="font-family: tahoma; font-size: 12; border-left: 1px solid
rgb(255,255,255); border-right: 1px solid rgb(128,128,128); border-top: 1px
solid rgb(255,255,255); border-bottom: 1px solid rgb(128,128,128)">
<div align="center"><center>

<table border="0" cellpadding="2" width="100%" style="font-family: tahoma;
font-size: 12">
<tr>
<td width="100%"><p style="font-family: Tahoma; font-size: 18;
font-weight: bold"><strong>Simple
Software Inventory<br>
</strong></p>
<p style="font-family: Tahoma; font-size: 18; font-weight:
normal"><small><small>Computername:</small></small></p>
<p>&nbsp; <input type="text" name="ComputerNameBox" size="24"
style="border: 1px solid"> <input
id="runbutton" class="button" Value="Audit" type="button"
name="GetSoftwareInventoryRun"
onClick="GetSoftwareInventory" style="font-family: Tahoma; font-size:
12; border: 1px solid"></p>

<div align="left">

<span id="DataSpan"></span>

</body>
</html>

Thanks for any help you can give me.







My System SpecsSystem Spec
Old 03-13-2009   #2 (permalink)
Joe Fawcett


 
 

Re: Strange HTA behaviour on newly restored WXP SP1

No idea but you could try try right-clicking > Run With and find mshta.exe.
I think it's in the system folder but you may need to search first.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name
"Paul Randall" <paulr90@xxxxxx> wrote in message
news:eNOd0u2oJHA.1292@xxxxxx
Quote:

> Hi,
> I've bought a set of system restore disks for a Compaq desktop and done
> the restore to a new hard drive. It installs WXP SP1 plus all the typical
> crapware. After going through the initial bootup and setup stuff, I
> wanted to get a list of installed software so I could methodically get rid
> of the junk I didn't want. I downloaded the HTA at
> http://www.microsoft.com/technet/scr.../cscsw044.mspx
> and attempted to run it. All it does is display the HTA's source in an
> HTA window. If I build a simple HTA, it displays only the <body> text
> just fine. I've attached my two HTAs and appended them below.
>
> I'm hoping someone can give me some insights to why this fresh new system
> displays the tiny HTA correctly but displays the source file for the
> ListInstalledSoftware HTA. In both cases I can see that mshta.exe is
> started in windows task manager.
>
> Since I will be deleting a lot of the junk currently installed, I don't
> really want to upgrade IE to the latest version 6, to avoid confusion
> while uninstalling the trial Office 2003 and the other junk.
>
> Tiny HTA:
> <html>
> <head>
> <title>Simple HTA</title>
>
> <HTA:APPLICATION
> ID="Simple"
> APPLICATIONNAME="Simple HTA"
> SCROLL="Yes"
> ICON="ssi.ico"
> SINGLEINSTANCE="no"
> WINDOWSTATE="fixed"
Quote:

>>
> </head>
> <body>
> This is a simple HTA (HTML Application)
> </body>
> </html>
>
> ListInstalledSoftware HTA:
> <!--
>
> ** Simple Software Inventory **
>
> 2006/05/21
>
> Written by Jarno Mäki / IT Education Center Finland
>
> This HTA contacts your computer thru network and queries
> all the installed software that can be found from the
> registry.
>
> Note that this HTA doesn't work if target computer's
> firewall is enabled.
>
> Available from Microsoft's ScriptCenter
> http://www.microsoft.com/technet/scr.../cscsw044.mspx
> -->
> <html>
> <head>
> <title>Simple Software Inventory</title>
>
> <HTA:APPLICATION
> ID="objSSI"
> APPLICATIONNAME="Simple Software Inventory"
> SCROLL="Yes"
> ICON="ssi.ico"
> SINGLEINSTANCE="no"
> WINDOWSTATE="fixed"
Quote:

>>
> </head>
>
> <SCRIPT Language="VBScript">
>
> Public strUser
>
> Sub Window_onLoad
>
> self.Focus()
> self.ResizeTo 550,550
> self.MoveTo 200,200
>
> DataSpan.InnerHtml = "<em>Write the computer's name to the textbox you
> want to audit.</em>"
>
> End Sub
>
>
> Sub GetSoftwareInventory()
> On Error Resume Next
>
> Const HKLM = &H80000002
> strComputer = ComputerNameBox.Value
> 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")
>
> If Err.Number <> 0 Then Call ErrorCheck(Err.Number, Err.Description)
>
>
> objReg.EnumKey HKLM, strKey, arrSubkeys
>
> For Each strSubkey In arrSubkeys
>
> strIsReal = 0
>
> intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
> strEntry1a, strValue1)
> If intRet1 <> 0 Then
>
> objReg.GetStringValue HKLM, strKey & strSubkey, _
> strEntry1b, strValue1
> End If
> If strValue1 <> "" Then
> strIsReal = 1
> strSoftat = strSoftat & "<b>" & strValue1 & "</b>" & " - "
>
> End If
> objReg.GetStringValue HKLM, strKey & strSubkey, _
> strEntry2, strValue2
> If strValue2 <> "" Then
> strSoftat = strSoftat & "<font color=""#0000A0"">" & strValue2 &
> "</font> - "
>
> End If
> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
> strEntry3, intValue3
> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
> strEntry4, intValue4
> If intValue3 <> "" Then
> strSoftat = strSoftat & "<font color=""#008040"">" & intValue3 &
> "." & intValue4 & "</font> - "
>
> End If
> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
> strEntry5, intValue5
> If intValue5 <> "" Then
> strSoftat = strSoftat & "<font color=""#808000"">" &
> Round(intValue5/1024, 3) & " megabytes </font><br>"
>
> Else
> if strIsReal = 1 then strSoftat = strSoftat & "<br>"
>
> End If
> Next
>
> DataSpan.InnerHtml = strSoftat
>
> End Sub
>
>
> Sub ErrorCheck(sErrorCode, sErrorDescription)
>
> Select Case sErrorCode
>
> Case 462
>
> MsgBox "Target computer is not found!" & vbCrLf & VbCrLf _
> & "Check that target computer is online and" & vbCrLf _
> & "it's local firewall is disabled.",64,"Computer not found"
>
> Err.Clear
>
> Case Else
>
> MsgBox "Error occurred." & vbCrLf & VbCrLf _
> & "Error code is:" & sErrorCode & vbCrLf _
> & "Error description is: " & sErrorDescription,64,"Mystical
> error occurred"
>
> Err.Clear
>
> End Select
>
> End Sub
>
>
> </SCRIPT>
>
>
> <body bgcolor="#D4D0C8" topmargin="0" leftmargin="0"
> style="font-family: tahoma; font-size: 12; border-left: 1px solid
> rgb(255,255,255); border-right: 1px solid rgb(128,128,128); border-top:
> 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(128,128,128)">
> <div align="center"><center>
>
> <table border="0" cellpadding="2" width="100%" style="font-family: tahoma;
> font-size: 12">
> <tr>
> <td width="100%"><p style="font-family: Tahoma; font-size: 18;
> font-weight: bold"><strong>Simple
> Software Inventory<br>
> </strong></p>
> <p style="font-family: Tahoma; font-size: 18; font-weight:
> normal"><small><small>Computername:</small></small></p>
> <p>&nbsp; <input type="text" name="ComputerNameBox" size="24"
> style="border: 1px solid"> <input
> id="runbutton" class="button" Value="Audit" type="button"
> name="GetSoftwareInventoryRun"
> onClick="GetSoftwareInventory" style="font-family: Tahoma; font-size:
> 12; border: 1px solid"></p>
>
> <div align="left">
>
> <span id="DataSpan"></span>
>
> </body>
> </html>
>
> Thanks for any help you can give me.
>
>


My System SpecsSystem Spec
Old 03-13-2009   #3 (permalink)
Stefan Kanthak


 
 

Re: Strange HTA behaviour on newly restored WXP SP1

"Paul Randall" <paulr90@xxxxxx> wrote:
Quote:

> Hi,
> I've bought a set of system restore disks for a Compaq desktop and done the
> restore to a new hard drive. It installs WXP SP1 plus all the typical
> crapware.
OUCH!
Do yourself a favor and dont use those CDs to setup any system for productive
use. Just extract the I386 directory from the installed system and then
build your own SP3 slipstream CD with it. Use that for a clean install!

Stefan

My System SpecsSystem Spec
Old 03-13-2009   #4 (permalink)
Paul Randall


 
 

Re: Strange HTA behaviour on newly restored WXP SP1


"Stefan Kanthak" <postmaster@[127.0.0.1]> wrote in message
news:u6SWoZ$oJHA.5100@xxxxxx
Quote:

> "Paul Randall" <paulr90@xxxxxx> wrote:
>
Quote:

>> Hi,
>> I've bought a set of system restore disks for a Compaq desktop and done
>> the
>> restore to a new hard drive. It installs WXP SP1 plus all the typical
>> crapware.
>
> OUCH!
> Do yourself a favor and dont use those CDs to setup any system for
> productive
> use. Just extract the I386 directory from the installed system and then
> build your own SP3 slipstream CD with it. Use that for a clean install!
I'm doing this for a friend. In general, I think your idea is a good one.
I haven't messed with slipstreaming for a few years. The last one I did
was to slipstream a Dell WXP installation disk. The original needed no
product ID during installation, and being a bare XP disk, installed no
crapware. I believe the slipsteam-upgraded version also need no product ID
during installation on a Dell computer, but both the original and
slipstreamed versions did ask for product ID when attempting to install on
other computers.

Actually, I believe Compaq/HP computers like this one use WinPE, Python &
other scripts and batch files to direct what happens during initial startup.
Those restore CDs restore the hard drive to that 'pre first boot' condition.
Perhaps I should look at what is actually going on during first boot, and
modify the WinPE/script/batch files to skip installing the crapware I don't
want.

-Paul Randall


My System SpecsSystem Spec
Old 03-13-2009   #5 (permalink)
Paul Randall


 
 

Re: Strange HTA behaviour on newly restored WXP SP1

Hopefully I will have time to experiment with pieces of the long script to
see what exactly triggers mshta's switching from interpreting the HTA to
listing its contents.

-Paul Randall

"Joe Fawcett" <joefawcett@xxxxxx> wrote in message
news:eHwl9b7oJHA.1172@xxxxxx
Quote:

> No idea but you could try try right-clicking > Run With and find
> mshta.exe. I think it's in the system folder but you may need to search
> first.
>
> --
>
> Joe Fawcett (MVP - XML)
> http://joe.fawcett.name
> "Paul Randall" <paulr90@xxxxxx> wrote in message
> news:eNOd0u2oJHA.1292@xxxxxx
Quote:

>> Hi,
>> I've bought a set of system restore disks for a Compaq desktop and done
>> the restore to a new hard drive. It installs WXP SP1 plus all the
>> typical crapware. After going through the initial bootup and setup
>> stuff, I wanted to get a list of installed software so I could
>> methodically get rid of the junk I didn't want. I downloaded the HTA at
>> http://www.microsoft.com/technet/scr.../cscsw044.mspx
>> and attempted to run it. All it does is display the HTA's source in an
>> HTA window. If I build a simple HTA, it displays only the <body> text
>> just fine. I've attached my two HTAs and appended them below.
>>
>> I'm hoping someone can give me some insights to why this fresh new system
>> displays the tiny HTA correctly but displays the source file for the
>> ListInstalledSoftware HTA. In both cases I can see that mshta.exe is
>> started in windows task manager.
>>
>> Since I will be deleting a lot of the junk currently installed, I don't
>> really want to upgrade IE to the latest version 6, to avoid confusion
>> while uninstalling the trial Office 2003 and the other junk.
>>
>> Tiny HTA:
>> <html>
>> <head>
>> <title>Simple HTA</title>
>>
>> <HTA:APPLICATION
>> ID="Simple"
>> APPLICATIONNAME="Simple HTA"
>> SCROLL="Yes"
>> ICON="ssi.ico"
>> SINGLEINSTANCE="no"
>> WINDOWSTATE="fixed"
Quote:

>>>
>> </head>
>> <body>
>> This is a simple HTA (HTML Application)
>> </body>
>> </html>
>>
>> ListInstalledSoftware HTA:
>> <!--
>>
>> ** Simple Software Inventory **
>>
>> 2006/05/21
>>
>> Written by Jarno Mäki / IT Education Center Finland
>>
>> This HTA contacts your computer thru network and queries
>> all the installed software that can be found from the
>> registry.
>>
>> Note that this HTA doesn't work if target computer's
>> firewall is enabled.
>>
>> Available from Microsoft's ScriptCenter
>> http://www.microsoft.com/technet/scr.../cscsw044.mspx
>> -->
>> <html>
>> <head>
>> <title>Simple Software Inventory</title>
>>
>> <HTA:APPLICATION
>> ID="objSSI"
>> APPLICATIONNAME="Simple Software Inventory"
>> SCROLL="Yes"
>> ICON="ssi.ico"
>> SINGLEINSTANCE="no"
>> WINDOWSTATE="fixed"
Quote:

>>>
>> </head>
>>
>> <SCRIPT Language="VBScript">
>>
>> Public strUser
>>
>> Sub Window_onLoad
>>
>> self.Focus()
>> self.ResizeTo 550,550
>> self.MoveTo 200,200
>>
>> DataSpan.InnerHtml = "<em>Write the computer's name to the textbox
>> you want to audit.</em>"
>>
>> End Sub
>>
>>
>> Sub GetSoftwareInventory()
>> On Error Resume Next
>>
>> Const HKLM = &H80000002
>> strComputer = ComputerNameBox.Value
>> 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")
>>
>> If Err.Number <> 0 Then Call ErrorCheck(Err.Number, Err.Description)
>>
>>
>> objReg.EnumKey HKLM, strKey, arrSubkeys
>>
>> For Each strSubkey In arrSubkeys
>>
>> strIsReal = 0
>>
>> intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
>> strEntry1a, strValue1)
>> If intRet1 <> 0 Then
>>
>> objReg.GetStringValue HKLM, strKey & strSubkey, _
>> strEntry1b, strValue1
>> End If
>> If strValue1 <> "" Then
>> strIsReal = 1
>> strSoftat = strSoftat & "<b>" & strValue1 & "</b>" & " - "
>>
>> End If
>> objReg.GetStringValue HKLM, strKey & strSubkey, _
>> strEntry2, strValue2
>> If strValue2 <> "" Then
>> strSoftat = strSoftat & "<font color=""#0000A0"">" & strValue2 &
>> "</font> - "
>>
>> End If
>> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
>> strEntry3, intValue3
>> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
>> strEntry4, intValue4
>> If intValue3 <> "" Then
>> strSoftat = strSoftat & "<font color=""#008040"">" & intValue3 &
>> "." & intValue4 & "</font> - "
>>
>> End If
>> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
>> strEntry5, intValue5
>> If intValue5 <> "" Then
>> strSoftat = strSoftat & "<font color=""#808000"">" &
>> Round(intValue5/1024, 3) & " megabytes </font><br>"
>>
>> Else
>> if strIsReal = 1 then strSoftat = strSoftat & "<br>"
>>
>> End If
>> Next
>>
>> DataSpan.InnerHtml = strSoftat
>>
>> End Sub
>>
>>
>> Sub ErrorCheck(sErrorCode, sErrorDescription)
>>
>> Select Case sErrorCode
>>
>> Case 462
>>
>> MsgBox "Target computer is not found!" & vbCrLf & VbCrLf _
>> & "Check that target computer is online and" & vbCrLf _
>> & "it's local firewall is disabled.",64,"Computer not found"
>>
>> Err.Clear
>>
>> Case Else
>>
>> MsgBox "Error occurred." & vbCrLf & VbCrLf _
>> & "Error code is:" & sErrorCode & vbCrLf _
>> & "Error description is: " & sErrorDescription,64,"Mystical
>> error occurred"
>>
>> Err.Clear
>>
>> End Select
>>
>> End Sub
>>
>>
>> </SCRIPT>
>>
>>
>> <body bgcolor="#D4D0C8" topmargin="0" leftmargin="0"
>> style="font-family: tahoma; font-size: 12; border-left: 1px solid
>> rgb(255,255,255); border-right: 1px solid rgb(128,128,128); border-top:
>> 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(128,128,128)">
>> <div align="center"><center>
>>
>> <table border="0" cellpadding="2" width="100%" style="font-family:
>> tahoma; font-size: 12">
>> <tr>
>> <td width="100%"><p style="font-family: Tahoma; font-size: 18;
>> font-weight: bold"><strong>Simple
>> Software Inventory<br>
>> </strong></p>
>> <p style="font-family: Tahoma; font-size: 18; font-weight:
>> normal"><small><small>Computername:</small></small></p>
>> <p>&nbsp; <input type="text" name="ComputerNameBox" size="24"
>> style="border: 1px solid"> <input
>> id="runbutton" class="button" Value="Audit" type="button"
>> name="GetSoftwareInventoryRun"
>> onClick="GetSoftwareInventory" style="font-family: Tahoma; font-size:
>> 12; border: 1px solid"></p>
>>
>> <div align="left">
>>
>> <span id="DataSpan"></span>
>>
>> </body>
>> </html>
>>
>> Thanks for any help you can give me.
>>
>>
>
>
>

My System SpecsSystem Spec
Old 03-16-2009   #6 (permalink)
Alex K. Angelopoulos


 
 

Re: Strange HTA behaviour on newly restored WXP SP1

You're probably waaay past this now, but I was going to hazard a guess that
the initial comment triggers parsing the content as text to be displayed in
an HTA rather than as instructions.

"Paul Randall" <paulr90@xxxxxx> wrote in message
news:eNOd0u2oJHA.1292@xxxxxx
Quote:

> Hi,
> I've bought a set of system restore disks for a Compaq desktop and done
> the restore to a new hard drive. It installs WXP SP1 plus all the typical
> crapware. After going through the initial bootup and setup stuff, I
> wanted to get a list of installed software so I could methodically get rid
> of the junk I didn't want. I downloaded the HTA at
> http://www.microsoft.com/technet/scr.../cscsw044.mspx
> and attempted to run it. All it does is display the HTA's source in an
> HTA window. If I build a simple HTA, it displays only the <body> text
> just fine. I've attached my two HTAs and appended them below.
>
> I'm hoping someone can give me some insights to why this fresh new system
> displays the tiny HTA correctly but displays the source file for the
> ListInstalledSoftware HTA. In both cases I can see that mshta.exe is
> started in windows task manager.
>
> Since I will be deleting a lot of the junk currently installed, I don't
> really want to upgrade IE to the latest version 6, to avoid confusion
> while uninstalling the trial Office 2003 and the other junk.
>
> Tiny HTA:
> <html>
> <head>
> <title>Simple HTA</title>
>
> <HTA:APPLICATION
> ID="Simple"
> APPLICATIONNAME="Simple HTA"
> SCROLL="Yes"
> ICON="ssi.ico"
> SINGLEINSTANCE="no"
> WINDOWSTATE="fixed"
Quote:

>>
> </head>
> <body>
> This is a simple HTA (HTML Application)
> </body>
> </html>
>
> ListInstalledSoftware HTA:
> <!--
>
> ** Simple Software Inventory **
>
> 2006/05/21
>
> Written by Jarno Mäki / IT Education Center Finland
>
> This HTA contacts your computer thru network and queries
> all the installed software that can be found from the
> registry.
>
> Note that this HTA doesn't work if target computer's
> firewall is enabled.
>
> Available from Microsoft's ScriptCenter
> http://www.microsoft.com/technet/scr.../cscsw044.mspx
> -->
> <html>
> <head>
> <title>Simple Software Inventory</title>
>
> <HTA:APPLICATION
> ID="objSSI"
> APPLICATIONNAME="Simple Software Inventory"
> SCROLL="Yes"
> ICON="ssi.ico"
> SINGLEINSTANCE="no"
> WINDOWSTATE="fixed"
Quote:

>>
> </head>
>
> <SCRIPT Language="VBScript">
>
> Public strUser
>
> Sub Window_onLoad
>
> self.Focus()
> self.ResizeTo 550,550
> self.MoveTo 200,200
>
> DataSpan.InnerHtml = "<em>Write the computer's name to the textbox you
> want to audit.</em>"
>
> End Sub
>
>
> Sub GetSoftwareInventory()
> On Error Resume Next
>
> Const HKLM = &H80000002
> strComputer = ComputerNameBox.Value
> 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")
>
> If Err.Number <> 0 Then Call ErrorCheck(Err.Number, Err.Description)
>
>
> objReg.EnumKey HKLM, strKey, arrSubkeys
>
> For Each strSubkey In arrSubkeys
>
> strIsReal = 0
>
> intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
> strEntry1a, strValue1)
> If intRet1 <> 0 Then
>
> objReg.GetStringValue HKLM, strKey & strSubkey, _
> strEntry1b, strValue1
> End If
> If strValue1 <> "" Then
> strIsReal = 1
> strSoftat = strSoftat & "<b>" & strValue1 & "</b>" & " - "
>
> End If
> objReg.GetStringValue HKLM, strKey & strSubkey, _
> strEntry2, strValue2
> If strValue2 <> "" Then
> strSoftat = strSoftat & "<font color=""#0000A0"">" & strValue2 &
> "</font> - "
>
> End If
> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
> strEntry3, intValue3
> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
> strEntry4, intValue4
> If intValue3 <> "" Then
> strSoftat = strSoftat & "<font color=""#008040"">" & intValue3 &
> "." & intValue4 & "</font> - "
>
> End If
> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
> strEntry5, intValue5
> If intValue5 <> "" Then
> strSoftat = strSoftat & "<font color=""#808000"">" &
> Round(intValue5/1024, 3) & " megabytes </font><br>"
>
> Else
> if strIsReal = 1 then strSoftat = strSoftat & "<br>"
>
> End If
> Next
>
> DataSpan.InnerHtml = strSoftat
>
> End Sub
>
>
> Sub ErrorCheck(sErrorCode, sErrorDescription)
>
> Select Case sErrorCode
>
> Case 462
>
> MsgBox "Target computer is not found!" & vbCrLf & VbCrLf _
> & "Check that target computer is online and" & vbCrLf _
> & "it's local firewall is disabled.",64,"Computer not found"
>
> Err.Clear
>
> Case Else
>
> MsgBox "Error occurred." & vbCrLf & VbCrLf _
> & "Error code is:" & sErrorCode & vbCrLf _
> & "Error description is: " & sErrorDescription,64,"Mystical
> error occurred"
>
> Err.Clear
>
> End Select
>
> End Sub
>
>
> </SCRIPT>
>
>
> <body bgcolor="#D4D0C8" topmargin="0" leftmargin="0"
> style="font-family: tahoma; font-size: 12; border-left: 1px solid
> rgb(255,255,255); border-right: 1px solid rgb(128,128,128); border-top:
> 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(128,128,128)">
> <div align="center"><center>
>
> <table border="0" cellpadding="2" width="100%" style="font-family: tahoma;
> font-size: 12">
> <tr>
> <td width="100%"><p style="font-family: Tahoma; font-size: 18;
> font-weight: bold"><strong>Simple
> Software Inventory<br>
> </strong></p>
> <p style="font-family: Tahoma; font-size: 18; font-weight:
> normal"><small><small>Computername:</small></small></p>
> <p>&nbsp; <input type="text" name="ComputerNameBox" size="24"
> style="border: 1px solid"> <input
> id="runbutton" class="button" Value="Audit" type="button"
> name="GetSoftwareInventoryRun"
> onClick="GetSoftwareInventory" style="font-family: Tahoma; font-size:
> 12; border: 1px solid"></p>
>
> <div align="left">
>
> <span id="DataSpan"></span>
>
> </body>
> </html>
>
> Thanks for any help you can give me.
>
>
My System SpecsSystem Spec
Old 03-16-2009   #7 (permalink)
Paul Randall


 
 

Re: Strange HTA behaviour on newly restored WXP SP1

Yes, I played with deleting parts of the initial comment, and certain
deletions did cause the the HTA to be interpreted properly. I was not able
to identify any particular part of the comment that caused the problem.
After uninstalling the junkware and upgrading to WXP SP3, the initial
comment is not a problem.

-Paul Randall

"Alex K. Angelopoulos" <aka(at)mvps.org> wrote in message
news:%23ZWyN1npJHA.4108@xxxxxx
Quote:

> You're probably waaay past this now, but I was going to hazard a guess
> that the initial comment triggers parsing the content as text to be
> displayed in an HTA rather than as instructions.
>
> "Paul Randall" <paulr90@xxxxxx> wrote in message
> news:eNOd0u2oJHA.1292@xxxxxx
Quote:

>> Hi,
>> I've bought a set of system restore disks for a Compaq desktop and done
>> the restore to a new hard drive. It installs WXP SP1 plus all the
>> typical crapware. After going through the initial bootup and setup
>> stuff, I wanted to get a list of installed software so I could
>> methodically get rid of the junk I didn't want. I downloaded the HTA at
>> http://www.microsoft.com/technet/scr.../cscsw044.mspx
>> and attempted to run it. All it does is display the HTA's source in an
>> HTA window. If I build a simple HTA, it displays only the <body> text
>> just fine. I've attached my two HTAs and appended them below.
>>
>> I'm hoping someone can give me some insights to why this fresh new system
>> displays the tiny HTA correctly but displays the source file for the
>> ListInstalledSoftware HTA. In both cases I can see that mshta.exe is
>> started in windows task manager.
>>
>> Since I will be deleting a lot of the junk currently installed, I don't
>> really want to upgrade IE to the latest version 6, to avoid confusion
>> while uninstalling the trial Office 2003 and the other junk.
>>
>> Tiny HTA:
>> <html>
>> <head>
>> <title>Simple HTA</title>
>>
>> <HTA:APPLICATION
>> ID="Simple"
>> APPLICATIONNAME="Simple HTA"
>> SCROLL="Yes"
>> ICON="ssi.ico"
>> SINGLEINSTANCE="no"
>> WINDOWSTATE="fixed"
Quote:

>>>
>> </head>
>> <body>
>> This is a simple HTA (HTML Application)
>> </body>
>> </html>
>>
>> ListInstalledSoftware HTA:
>> <!--
>>
>> ** Simple Software Inventory **
>>
>> 2006/05/21
>>
>> Written by Jarno Mäki / IT Education Center Finland
>>
>> This HTA contacts your computer thru network and queries
>> all the installed software that can be found from the
>> registry.
>>
>> Note that this HTA doesn't work if target computer's
>> firewall is enabled.
>>
>> Available from Microsoft's ScriptCenter
>> http://www.microsoft.com/technet/scr.../cscsw044.mspx
>> -->
>> <html>
>> <head>
>> <title>Simple Software Inventory</title>
>>
>> <HTA:APPLICATION
>> ID="objSSI"
>> APPLICATIONNAME="Simple Software Inventory"
>> SCROLL="Yes"
>> ICON="ssi.ico"
>> SINGLEINSTANCE="no"
>> WINDOWSTATE="fixed"
Quote:

>>>
>> </head>
>>
>> <SCRIPT Language="VBScript">
>>
>> Public strUser
>>
>> Sub Window_onLoad
>>
>> self.Focus()
>> self.ResizeTo 550,550
>> self.MoveTo 200,200
>>
>> DataSpan.InnerHtml = "<em>Write the computer's name to the textbox
>> you want to audit.</em>"
>>
>> End Sub
>>
>>
>> Sub GetSoftwareInventory()
>> On Error Resume Next
>>
>> Const HKLM = &H80000002
>> strComputer = ComputerNameBox.Value
>> 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")
>>
>> If Err.Number <> 0 Then Call ErrorCheck(Err.Number, Err.Description)
>>
>>
>> objReg.EnumKey HKLM, strKey, arrSubkeys
>>
>> For Each strSubkey In arrSubkeys
>>
>> strIsReal = 0
>>
>> intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
>> strEntry1a, strValue1)
>> If intRet1 <> 0 Then
>>
>> objReg.GetStringValue HKLM, strKey & strSubkey, _
>> strEntry1b, strValue1
>> End If
>> If strValue1 <> "" Then
>> strIsReal = 1
>> strSoftat = strSoftat & "<b>" & strValue1 & "</b>" & " - "
>>
>> End If
>> objReg.GetStringValue HKLM, strKey & strSubkey, _
>> strEntry2, strValue2
>> If strValue2 <> "" Then
>> strSoftat = strSoftat & "<font color=""#0000A0"">" & strValue2 &
>> "</font> - "
>>
>> End If
>> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
>> strEntry3, intValue3
>> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
>> strEntry4, intValue4
>> If intValue3 <> "" Then
>> strSoftat = strSoftat & "<font color=""#008040"">" & intValue3 &
>> "." & intValue4 & "</font> - "
>>
>> End If
>> objReg.GetDWORDValue HKLM, strKey & strSubkey, _
>> strEntry5, intValue5
>> If intValue5 <> "" Then
>> strSoftat = strSoftat & "<font color=""#808000"">" &
>> Round(intValue5/1024, 3) & " megabytes </font><br>"
>>
>> Else
>> if strIsReal = 1 then strSoftat = strSoftat & "<br>"
>>
>> End If
>> Next
>>
>> DataSpan.InnerHtml = strSoftat
>>
>> End Sub
>>
>>
>> Sub ErrorCheck(sErrorCode, sErrorDescription)
>>
>> Select Case sErrorCode
>>
>> Case 462
>>
>> MsgBox "Target computer is not found!" & vbCrLf & VbCrLf _
>> & "Check that target computer is online and" & vbCrLf _
>> & "it's local firewall is disabled.",64,"Computer not found"
>>
>> Err.Clear
>>
>> Case Else
>>
>> MsgBox "Error occurred." & vbCrLf & VbCrLf _
>> & "Error code is:" & sErrorCode & vbCrLf _
>> & "Error description is: " & sErrorDescription,64,"Mystical
>> error occurred"
>>
>> Err.Clear
>>
>> End Select
>>
>> End Sub
>>
>>
>> </SCRIPT>
>>
>>
>> <body bgcolor="#D4D0C8" topmargin="0" leftmargin="0"
>> style="font-family: tahoma; font-size: 12; border-left: 1px solid
>> rgb(255,255,255); border-right: 1px solid rgb(128,128,128); border-top:
>> 1px solid rgb(255,255,255); border-bottom: 1px solid rgb(128,128,128)">
>> <div align="center"><center>
>>
>> <table border="0" cellpadding="2" width="100%" style="font-family:
>> tahoma; font-size: 12">
>> <tr>
>> <td width="100%"><p style="font-family: Tahoma; font-size: 18;
>> font-weight: bold"><strong>Simple
>> Software Inventory<br>
>> </strong></p>
>> <p style="font-family: Tahoma; font-size: 18; font-weight:
>> normal"><small><small>Computername:</small></small></p>
>> <p>&nbsp; <input type="text" name="ComputerNameBox" size="24"
>> style="border: 1px solid"> <input
>> id="runbutton" class="button" Value="Audit" type="button"
>> name="GetSoftwareInventoryRun"
>> onClick="GetSoftwareInventory" style="font-family: Tahoma; font-size:
>> 12; border: 1px solid"></p>
>>
>> <div align="left">
>>
>> <span id="DataSpan"></span>
>>
>> </body>
>> </html>
>>
>> Thanks for any help you can give me.
>>
>>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Get-Process strange behaviour PowerShell
Strange behaviour! Vista account administration
newly restored files-where are they??? Vista file management
strange comparision behaviour/bug of -eq PowerShell
Strange Vista Behaviour Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46