不严格的话可以这样:- @echo off
- set /p qz=请输入前缀
- for /f "delims=" %%a in ('dir /a-d /b *.mp4') do ren "%%a" "%qz%%%a"
复制代码 若要严谨点可以这样:- @echo off&setlocal enabledelayedexpansion
- :start
- set /p qz=请输入前缀
- set qz=!qz:^^=^^!
- echo !qz!|findstr "[\\/:*?^<>|]"&&(echo 含有特殊字符!)&&goto start
- for /f "delims=" %%a in ('dir /a-d /b *.mp4') do ren "%%a" "!qz!%%a"
- pause
复制代码
|