for /f "tokens=1*delims=:" %%b in ('dir /on /b /a-d image*.png 2^|findstr /n ".*" ') do ren "%%b" "%%a.png" 作為批處理行,應(yīng)該按您的要求執(zhí)行。 啊-一個小小的誤讀。 @ECHO OFFSETLOCAL ENABLEDELAYEDEXPANSIONrem The following settings for the source directory, destination directory, target directory,rem batch directory, filenames, output filename and temporary filename [if shown] are namesrem that I use for testing and deliberately include names which include spaces to make surerem that the process works using such names. These will need to be changed to suit your situation.SET "sourcedir=u:\your files\t w o"SET /a newnumbe