发布网友 发布时间:2022-04-23 00:54
共1个回答
热心网友 时间:2023-07-22 15:42
@echo off追问输出的txt结果是这样的,不对啊……
ren "20140413-aaa.pdf" "aaa"
ren "20140603-bbb.pdf" "bbb"
ren "20140723-ccc.pdf" "ccc"
追答@echo off
setlocal enabledelayedexpansion
(for /f "delims==" %%i in ('dir /b /o:n *.pdf') do (
set fn=%%i
set /a n+=1
echo !n!、 !fn:~9,-4!))>final.txt