本帖最后由 batman 于 2012-9-27 23:30 编辑
为了方便,修改了分格符- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=1,2 delims=_." %%a in ('dir /b /o-n 日报表*.xls') do (
- if "%%b" equ "" (
- copy /y 日报表.xls "日报表%date:~5,2%-%date:~8,2%_1.xls"
- ) else (
- set /a a=%%b+1
- copy /y 日报表.xls "日报表%date:~5,2%-%date:~8,2%_!a!.xls"
- )
- exit
- )
复制代码
|