执行32位和64位mshta.exe(绕过默认处理程序) [英] Executing 32bit and 64bit mshta.exe (bypass default handler)

查看:257
本文介绍了执行32位和64位mshta.exe(绕过默认处理程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够以32位和64位版本的mshta.exe启动page.hta.

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

创建文件c:\ page.hta

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("\n")+taEnd);
</script>
</body>

现在这是尝试以不同方式加载页面的批处理文件.

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

@echo off
rem Launch 32bit
c:\Windows\SysWOW64\mshta.exe c:\page.hta

rem Launch 64bit
c:\Windows\System32\mshta.exe c:\page.hta

另一件有趣的事情,尝试将.hta文件的默认处理程序更改为记事本.如果执行前面的命令,它将启动记事本.看来mshta具有一些只能通过默认处理程序启动.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.

推荐答案

也许这不是操作系统版本的问题(?),因为您的测试在我的XP x64上按预期运行了.

Maybe it's a OS version issue (?) I can't tell, as your test run as expected on my XP x64.

我运行的代码:

Rem run32.bat
%WinDir%\SysWOW64\mshta.exe c:\page.hta

Rem run64.bat
%WinDir%\System32\mshta.exe c:\page.hta

这是我得到的:

这篇关于执行32位和64位mshta.exe(绕过默认处理程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆