Forum posts for mshta.exe

Executing 32bit and 64bit mshta.exe (bypass default handler)

I'd like to be able to launch a page.hta in 32bit and 64bit versions of the mshta.exe.

Create the file c:page.hta

<body onclick='if(confirm('Close? (onclick)')){self.close();}'>
<h1>Test Page</h1>
<script type='text/javascript'>
var elem = [
'UserAgent='+window.navigator.userAgent,
'Platform='+window.navigator.platform
];
var taBegin = '<textarea style='width:100%' rows=''+((elem.length+1)*1.5)+''>';
var taEnd = '</textarea>';
document.write(taBegin+elem.join(' ')+taEnd);
</script>
</body>


Now here is the batch file to attemp to load the page differently.

@echo off
rem Launch 32bit
c:WindowsSysWOW64mshta.exe c:page.hta

rem Launch 64bit
c:WindowsSystem32mshta.exe c:page.hta


Another interesting thing, try changing the default handler to notepad for .hta files. If you execute the previous commands, and it launches notepad. It appears that mshta has some logic that only launches the .hta via the default handler.

Whatever command is specified as the default handler is used.

View complete forum thread with replies

Other posts related to mshta.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

Executing 32bit and 64bit mshta.exe (bypass default handler)
mshta.exe process keeps running after closing HTA
Standalone HTML Application
How to debug IE9 HTA?

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.