回复 1# 海面嘎
请参考Q-04把bat文件保存为ANSI编码:
https://mp.weixin.qq.com/s/6lbb97qUOs1sTyKJfN0ZEQ- @echo off
- setlocal enabledelayedexpansion
- set "max=0"
- set "fileList=m-101-1.txt m-103-1.txt m-102-1.txt"
- for %%a in (%fileList%) do (
- for /f "tokens=1-3 delims=-" %%b in ("%%a") do (
- if %%c gtr !max! (
- set "max=%%c"
- )
- set "newestFile=%%b-!max!-%%d"
- )
- )
- echo,!newestFile!
- pause
复制代码
|