本帖最后由 jyswjjgdwtdtj 于 2023-6-3 13:14 编辑
嗯 突然想起来之前做过一个- //jscript or javascript
- //ie
-
- function getvbsfilepath(){
- return new ActiveXObject("excel.application").GetOpenFileName("VBScript Files (*.vbs *.vbe),*.vbs;*.vbe",1,"打开VBScript脚本文件")
- }
- function savevbsfilepath(filename){
- return new ActiveXObject("excel.application").GetSaveAsFilename(filename,"VBScript Files (*.vbs *.vbe),*.vbs;*.vbe",1,"另存为VBScript脚本文件")
- }
复制代码 调用excel的原生方法 即vba里的application对象
所以不用安装vba 有wps或office就行- @ECHO OFF
- setlocal enabledelayedexpansion
- call :File_Input "files" "输入文件"&& echo 输入文件=!输入文件!
- echo Files=%files%
- echo 调试结束&&pause&&exit
-
-
- goto :eof
-
- ::**************************************************************
- :: 输入文件名称
- ::**************************************************************
- :File_Input
- Title ★★★★★ %~n0 %~2 ★★★★★
- if "%2" NEQ "" set %~2=No
- for /f "delims=" %%a in ('mshta "about:<script>new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Write(new ActiveXObject('excel.application').GetOpenFileName('VBScript Files (*.vbs *.vbe),*.vbs;*.vbe',1,'打开VBScript脚本文件'));close();</script>"') do set %~1="%%a"
- if "%~1" NEQ "" if "%2" NEQ "" set %~2=Yes
- Title ★★★★★ %~n0 ★★★★★
- goto :eof
复制代码
|