bat批处理重命名问题

由于要重命名的字符串中有文字,致使重命名出来的文件名都变为乱码了,查理一下须要加两句话html

1.post

@Echo Off

Chcp 65001>nul

SetLocal EnableDelayedExpansion

for /f %%i in ('dir /b *.PDF') do (ren %%i 文字_%%i)

Chcp 936>nul

 http://zhidao.baidu.com/question/303817950046214524.htmlurl

 

2. 循环加数字自增加spa

@Echo Off
SetLocal EnableDelayedExpansion
For /R %%i In (*.txt) Do (
    Set /A Ti+=1
    Set Ti=0!Ti!
    Ren "%%~nxi" "!Ti:~-2!%%~nxi"
)

 

3. 文字替换code

@Echo Off
SetLocal EnableDelayedExpansion
For %%i In (*.txt) Do (
    For /F "Usebackq Delims=" %%j In ("%%~nxi") Do (
        Set Str=%%j
        Echo !Str:BG-hd=%%~ni!>>New_%%~nxi
    )
)

 

BAT实现照片文件批量更名

http://www.cnblogs.com/meil/archive/2013/03/12/2955019.htmlhtm

 

for命令详解blog

http://mmmzzc.iteye.com/blog/1090309 字符串

Dos/Batget

http://www.jbxue.com/jb/dos/it

相关文章
相关标签/搜索