Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在一个文件夹中有许多图像,其中许多图像-的文件名中带有破折号 ( )。我想批量重命名所有文件,特别是删除破折号后的破折号和字符。
-
我该怎么做?
for /f "delims=" %%a in ('dir /b /a-d *-*') do ( for /f "delims=-" %%b in ("%%~na") do ( if "%%~b" neq "%%~na" echo ren "%%~a" "%%~b%%~xa" ) )