我试图运行此命令:
mshta javascript:alert("Thanks for taking a look at my question! :D");close();
它在cmd提示符下正常运行,但是当放在批处理文件中时,我收到此错误:
close() was unexpected at this time.
答案 0 :(得分:3)
在批处理脚本中,分号是终止mshta命令,而不是像你想要的那样终止HTA命令。您必须引用HTA命令,或者向mshta.exe提供脚本。
我认为这应该有效:
mshta "javascript:alert('Thanks for taking a look at my question! :D');close();"