【发布时间】:2015-01-29 14:21:47
【问题描述】:
我正在尝试浏览文件。
它作为一个简单的 vbs 可以正常工作,但是在 HTA 中会产生错误。
像这样:
sUserList = BrowseToFile
msgbox sUserList
Function BrowseToFile
Set wShell=CreateObject("WScript.Shell")
Set oExec=wShell.Exec("mshta.exe ""about:<input type=file id=FILE><script>FILE.click();new ActiveXObject(""Scripting.FileSystemObject"").GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);</script>""")
BrowseToFile = oExec.StdOut.ReadLine
End Function
错误:
Line 130: Is the wShell.exec
Char 203:
Unterminated String Constant.
我可以调用一个单独的 vbs 并写入文件然后以这种方式获取它。
【问题讨论】:
-
HTA 测试 head> -
请不要在 cmets 中发布代码 sn-ps,因为它变得有点不可读。 Update your question,请。