【发布时间】:2018-06-14 14:38:08
【问题描述】:
我在 Windows 7/10 中使用以下脚本打开文件对话框并允许用户选择文件。即使添加了多个属性,它也不允许我选择多个文件。根据this,我应该可以使用<input type="file"> 的multiple 属性来选择多个文件。
Set wShell = CreateObject("WScript.Shell")
Set oExec = wShell.Exec("mshta.exe ""about:<input type=file id=FILE name=file multiple><script>FILE.click();new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);</script>""")
sFileSelected = oExec.StdOut.ReadLine
WScript.Echo sFileSelected
【问题讨论】:
-
尝试替换为
id='files' name='files[]'- 是不允许选择多个文件还是在读取结果时显示值有问题 -
我记得
multiple属性在 IE10 甚至 IE11 之前都不支持,您在哪种文档模式下运行该应用程序?
标签: html vbscript jscript hta filesystemobject