Dialogbox文件过滤器

时间:2017-11-13 16:06:11

标签: .net batch-file cmd

如何在此处仅查看.txt

screenshot of an file open dialog in Windows

来源来自https://stackoverflow.com/a/37079633/8927505

set dialog="about:<input type=file id=FILE><script>FILE.click();new ActiveXObject
set dialog=%dialog%('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);
set dialog=%dialog%close();resizeTo(0,0);</script>"

for /f "tokens=* delims=" %%p in ('mshta.exe %dialog%') do set "file=%%p"
echo selected  file is : "%file%"

0 个答案:

没有答案