@echo off & setlocal enabledelayedexpansion
title BAT-GO团队奉献 http://zhidao.baidu.com/team/view/BAT-GO
set a=
set b=
set c=
set xz=
cls&echo 【1】替换sdfsfdsf_abcd 【2】替换oiewsdf
echo.
set /p a=你想替换什么字符,请选择1或2:
if "!a!"=="1" set b=sdfsfdsf_abcd
if "!a!"=="2" set b=oiewsdf
cls&set /p c=你想将!b!替换城什么字符:
for /f "delims=" %%a in ('dir /s /b /ad "*!b!*"') do (
set xz=%%a
echo 正在替换!xz!
move /y "!xz!" "!xz:%b%=%c%!" >nul 2>nul
)
echo OK!
pause
@echo off& mode con cols=40 lines=10
setlocal enabledelayedexpansion& color 07
echo please type the old string& set /p wind_O=& echo.
echo please type the new string& set /p wind_N=& cls
for /d %%1 in (*)do (set wind=%%1
rename "!wind!" "!wind:%wind_O%=%wind_N%!")
用工具来做比较简单,也比较自由,谷歌搜索“灵者更名”