需求:将当前文件夹下的所有文件 xxxx.cs 改为 xxxx@input.cs (@input为用户输入的字符串)
@echo Created By Stephen Cui
@echo 2014.12.25 Christmas Day
@echo modify "xxxxxxxx.cs"
set/p option=Please input suffix (_Model,_BLL,_DAL):
echo File will change to xxxx%option%
for /f "delims=" %%i in ('dir *.cs /a-d/b') do ren "%%i" %%~ni%option%.cs
echo Rename all files finish!
pause
Update 2015.01.04 22:17
@海阔天空XM
怎么用?
复制以上内容至文本并另存为aaa.bat,然后将bat和目标文件放在同一目录下,双击bat即可。