Discussion:
demo.hta is not a valid Win32 application.
(too old to reply)
Dave "Crash" Dummy
2017-04-03 23:54:49 UTC
Permalink
I want to share some HTA scripts with a friend of mine. In the past,
this has not been a problem, but something has happened to his XP system
and attempts to run scripts yield the error in the subject line, even
with the bare bones demo below. He has checked and mshta.exe is where it
is supposed to be. I suspect that some aggressive cleanup utility
stripped something out of the registry. Any suggestions on how to fix
this problem?

'=================== demo.hta =====================
<HTA:APPLICATION ID="oHTA" APPLICATIONNAME="myApp" >
<HTML>
<HEAD><TITLE></TITLE>
<STYLE type="text/css">
body {font-size:64pt;text-align:center;}
</STYLE>
</HEAD>
<BODY>
Hello, World!
</BODY>
</HTML>
'================================================
--
Crash

Life is short. Eat dessert first.
Mayayana
2017-04-04 01:04:51 UTC
Permalink
"Dave "Crash" Dummy" <***@invalid.invalid> wrote

| I suspect that some aggressive cleanup utility
| stripped something out of the registry. Any suggestions on how to fix
| this problem?

I would export HKCR\.hta and HKCR\htafile,
send those to him, and explian how to merge
them. That's the essence of how a file gets
treated when it's double-clicked. Especially
important is the value in shell\open\command.
I have the following:

C:\WINDOWS\System32\mshta.exe "%1" %*
Dave "Crash" Dummy
2017-04-04 02:08:52 UTC
Permalink
| I suspect that some aggressive cleanup utility | stripped something
out of the registry. Any suggestions on how to fix | this problem?
I would export HKCR\.hta and HKCR\htafile, send those to him, and
explian how to merge them. That's the essence of how a file gets
treated when it's double-clicked. Especially important is the value
C:\WINDOWS\System32\mshta.exe "%1" %*
That's what I figured, but nothing is ever simple. In my 64 bit Windows
10 system I have

@="C:\\Windows\\SysWOW64\\mshta.exe \"%1\"
{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}%U{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}
%*"

I could change it and try it out, but my friend is 2000 miles away, 85
years old, and technically challenged. Undoing changes if it doesn't
work would be beyond him. I'd want to see what is already in his
registry for .hta and htafile before adding anything. Maybe I can walk
him through it.
--
Crash

One man's weed is another man's wildflower.
Mayayana
2017-04-04 13:36:01 UTC
Permalink
"Dave "Crash" Dummy" <***@invalid.invalid> wrote

| > C:\WINDOWS\System32\mshta.exe "%1" %*
|
| That's what I figured, but nothing is ever simple. In my 64 bit Windows
| 10 system I have
|
| @="C:\\Windows\\SysWOW64\\mshta.exe \"%1\"
|
{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}%U{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}
| %*"
|

But your friend has XP, right? I'm taking my readings
from XP. You don't want to give him Win10 settings.
(I'm not familiar with that use of CLSIDs in the command
line, but I can tell you that particular CLSID is not listed
under my HKCR\CLSID\ key. There's a good chance that
it's Win10-specific.)

In case it's useful, below is the content of 2 .reg
files for my .hta and htafile keys. I don't see anything
critical except the .hta values and the command key
default value.
If that's not a problem I'd look at AV interference or
file corruption. (The HTA may be saved in unicode, for
instance, or some other issue that may conflict going
from 64 to 32.)

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.hta]
@="htafile"
"Content Type"="application/hta"

[HKEY_CLASSES_ROOT\.hta\PersistentHandler]
@="{eec97550-47a9-11cf-b952-00aa0051fe20}"


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\htafile]
@="HTML Application"
"EditFlags"=dword:00000000
"BrowserFlags"=dword:00000008

[HKEY_CLASSES_ROOT\htafile\CLSID]

[HKEY_CLASSES_ROOT\htafile\DefaultIcon]
@="C:\\WINDOWS\\NewIconStorage\\hta.ico,0"

[HKEY_CLASSES_ROOT\htafile\Shell]
@=""

[HKEY_CLASSES_ROOT\htafile\Shell\Open]

[HKEY_CLASSES_ROOT\htafile\Shell\Open\Command]
@="C:\\WINDOWS\\System32\\mshta.exe \"%1\" %*"

[HKEY_CLASSES_ROOT\htafile\shellex]

[HKEY_CLASSES_ROOT\htafile\shellex\DropHandler]
@="{EA19346A-4F28-452D-B488-1B62155D6ADD}"
"exefile"="C:\\WINDOWS\\system32\\mshta.exe"
"runfile"="y"
Dave "Crash" Dummy
2017-04-04 15:23:37 UTC
Permalink
| > C:\WINDOWS\System32\mshta.exe "%1" %* | | That's what I figured,
but nothing is ever simple. In my 64 bit Windows | 10 system I have |
{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}%U{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}
| %*" |
But your friend has XP, right? I'm taking my readings from XP. You
don't want to give him Win10 settings. (I'm not familiar with that
use of CLSIDs in the command line, but I can tell you that particular
CLSID is not listed under my HKCR\CLSID\ key. There's a good chance
that it's Win10-specific.)
In case it's useful, below is the content of 2 .reg files for my .hta
and htafile keys. I don't see anything critical except the .hta
values and the command key default value. If that's not a problem I'd
look at AV interference or file corruption. (The HTA may be saved in
unicode, for instance, or some other issue that may conflict going
from 64 to 32.)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.hta\PersistentHandler]
@="{eec97550-47a9-11cf-b952-00aa0051fe20}"
Windows Registry Editor Version 5.00
"EditFlags"=dword:00000000 "BrowserFlags"=dword:00000008
[HKEY_CLASSES_ROOT\htafile\CLSID]
[HKEY_CLASSES_ROOT\htafile\DefaultIcon]
@="C:\\WINDOWS\\NewIconStorage\\hta.ico,0"
[HKEY_CLASSES_ROOT\htafile\Shell\Open]
[HKEY_CLASSES_ROOT\htafile\Shell\Open\Command]
@="C:\\WINDOWS\\System32\\mshta.exe \"%1\" %*"
[HKEY_CLASSES_ROOT\htafile\shellex]
[HKEY_CLASSES_ROOT\htafile\shellex\DropHandler]
@="{EA19346A-4F28-452D-B488-1B62155D6ADD}"
"exefile"="C:\\WINDOWS\\system32\\mshta.exe" "runfile"="y"
Thank you. I expect my Windows 10 configuration to be very different
than the XP version. Therein lies the problem. You don't say which
system you extracted those registry keys from.

I really want to avoid trying to edit his registry from afar. I am going
to try a work around using a shortcut to
"mshta.exe d:\path\demo.hta"
--
Crash

"Never underestimate the power of the Dark Side."
~ Obi-Wan Kenobi ~
Mayayana
2017-04-04 17:26:09 UTC
Permalink
"Dave "Crash" Dummy" <***@invalid.invalid> wrote

| You don't say which
| system you extracted those registry keys from.

XP. I mentioned it in the last post. I normally run
on XP, using Win7 mostly for software testing,
helping others, and as a sacrificial lamb when I
want to do something risky or non-private online.



| I really want to avoid trying to edit his registry from afar.

That's why I posted the .reg file content. You could
email him .reg files, maybe as .txt files. I know what
you mean, though. Any remote help can get very
complicated, very quickly.
Dave "Crash" Dummy
2017-04-04 18:09:50 UTC
Permalink
Post by Mayayana
| You don't say which
| system you extracted those registry keys from.
XP. I mentioned it in the last post. I normally run
on XP, using Win7 mostly for software testing,
helping others, and as a sacrificial lamb when I
want to do something risky or non-private online.
| I really want to avoid trying to edit his registry from afar.
That's why I posted the .reg file content. You could
email him .reg files, maybe as .txt files. I know what
you mean, though. Any remote help can get very
complicated, very quickly.
The shortcut scheme worked, so I'm not going to mess with the registry.
--
Crash

Life is short. Eat dessert first.
JJ
2017-04-04 17:43:38 UTC
Permalink
Post by Mayayana
[HKEY_CLASSES_ROOT\.hta\PersistentHandler]
@="{eec97550-47a9-11cf-b952-00aa0051fe20}"
If that is included, below registry subkey should be deleted too, in order
to reset the file association to that REG file (long text warning).

Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.hta]
Dave "Crash" Dummy
2017-04-04 18:15:08 UTC
Permalink
Post by JJ
Post by Mayayana
[HKEY_CLASSES_ROOT\.hta\PersistentHandler]
@="{eec97550-47a9-11cf-b952-00aa0051fe20}"
If that is included, below registry subkey should be deleted too, in
order to reset the file association to that REG file (long text
warning).
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.hta]
Thank you. As I told Mayayana, I can get the HTA script to run using a
shortcut to mshta.exe with an included argument. I'm not going to try to
edit my friends registry long distance.
--
Crash

When it comes to texting, some people are all thumbs.
Loading...