comicguests (Freya)当前离线
三级士官
set Choice= echo 请将要加前缀文件夹直接拖入本窗口: echo. set /p Choice= if ""%Choice%"" == "" goto 2 set/p k=要添加的前缀为: if "%k%" == "ml" (goto ml) for /f "delims=" %%i in ('dir /s /b "%choice%"') do ren %%i %k%%%i复制代码
Hello123World 当前离线
荣誉版主
@echo off&SetLocal EnableDelayedExpansion Set /p str=请输入要添加的前缀: for /r %%i in (*.*) do ren "%%i" "%str%%%~nxi" pause>nul复制代码
TOP
zaixinxiangnian 当前离线
二级士官
hfg1977 当前离线
上尉
@echo off&SetLocal EnableDelayedExpansion set Choice= echo 请将要加前缀文件夹直接拖入本窗口,然后回车: echo. set /p Choice= Set /p str=请输入要添加的前缀: for /r %%i in (*.*) do ren "%%i" "%str%%%~nxi" pause>nul复制代码
for /f "delims=" %%1 in ('dir /s /a /b') do (set wind=%%~nx1 ren "%%~1" "!wind:你的前缀=!")复制代码
ArdentMan 当前离线
中尉
@echo off&SetLocal EnableDelayedExpansion for /r %%i in (*.*) do set val=%%~nxi&echo !val! pause>nul复制代码
@echo off&SetLocal EnableDelayedExpansion Set /p str=请输入要去除的前缀: for /r %%i in (*.*) do ( Set nstr="%%~ni" Set nstr=!nstr:%str%=! ren "%%i" "!nstr!%%~xi" ) pause>nul复制代码