使用VBScript选择多个文件

时间:2018-06-14 14:38:08

标签: html5 vbscript jscript hta filesystemobject

我在Windows 7/10中使用以下脚本打开文件对话框并允许用户选择文件。即使添加了多个属性,它也不允许我选择多个文件。根据{{​​3}},我应该能够使用带有<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

1 个答案:

答案 0 :(得分:0)

如果这是HTA,请在head标签内添加以下代码:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10"/>