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

我只是一个虾纸丫 提交于 2019-12-05 19:24:34

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

[EDIT] The code I run:

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

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

Here is what I get:

the system32/systemwow64 folders are "virtual" in the sense that their content is determined by the OS depending on the bitness of the accessing application - in your case cmd.exe is probably the 64 Bit version so it will always start the 64 Bit-version of the mshta.exe

for starting a command prompt in 32 bit see http://astatalk.com/thread/7382/0/How_to_Open_and_Run_32-bit_Command_Prompt_in_x64_Windows/

it could also help to use SysNative instead of system32 and see how mshta.exe acts then...

mshata.exe seems to just use the standard settings for .hta so that it propbably won't matter whether you start the 32bit or the 64bit version of mshta.exe - you can try by associating .hta with 32 bit sersion of your browser...

IF you want to bypass that then you could just call the browser (32 bit or 64 bit) directly in your batch file...

EDIT - as per comment:

For 64 Bit execution you could use "C:\Program Files\Internet Explorer\iexplore.exe" in your batch file and
for 32 Bit execution you use "C:\Program Files (x86)\Internet Explorer\iexplore.exe".

Depending on youd system you need to open up a command shell with the desired bitness - see the link above.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!