批处理修改文件夹下面所有文件拓展名
主要命令
ren *.aiml *.aimlx
示例代码
@ECHO OFF
set deleteString=.mp4.torrent.htm
set listFile=list.tmp
del "%listFile%" /q 1>nul 2>nul
dir *.mp4.torrent.htm /a /b>>"%listFile%"
FOR /F "tokens=*" %%a IN (
'more "%listFile%"'
) DO (
SETLOCAL ENABLEDELAYEDEXPANSION
set newFileName=%%a
set newFileName=!newFileName:%deleteString%=!
ren "%%a" "!newFileName!"
ENDLOCAL
)
del "%listFile%" /q 1>nul 2>nul
PAUSE
示例下载
代码作用:删除后缀拓展名htm。