自己先备份文件,先测试...复制代码
- @echo off
- cd /d %~dp0
- set exeName=EXCEL.exe
- set EXEPATH="C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE"
- for /f "delims=" %%i in ('dir /b /a-d *.xlsm') do (
- setlocal enabledelayedexpansion
- set "fileName=%%~nxi"
- set cmdMsg=/batOpen
- %exePath% "!fileName!" !cmdMsg!
- endlocal
- pause
- )
- pause
欢迎光临 批处理之家 (http://www.bathome.net/) | Powered by Discuz! 7.2 |