bat小工具之批量文件排序命名

您所在的位置:网站首页 怎么批量修改文件名称按顺序 bat小工具之批量文件排序命名

bat小工具之批量文件排序命名

2023-09-05 06:55| 来源: 网络整理| 查看: 265

未规定重命名位数批量文件排序.bat

@echo off setlocal enabledelayedexpansion set count=0 for /f %%i in ('dir /b *.bmp') do (     set /a count+=1     echo 改名:%%i !count!     rename %%i !count!.bmp )

 

规定重命名位数批量文件排序.bat            (1000表明是3位(000-999))

@echo off setlocal enabledelayedexpansion set count=1000 for /f "delims=" %%i in ('dir /b *.jpg,*.png,*.bmp,*.jpeg,*.gif') do call:Rename "%%~i" pause exit   :Rename set /a count+=1 if /i "%~1"=="!count:~1!%~x1" goto :eof if exist "!count:~1!%~x1" goto Rename echo 改名:%1 !count:~1! ren "%~1" "!count:~1!%~x1" goto :eof

 

获取文件列表.bat

@echo off  for /f "delims=" %%a in ('dir /b/a-d/oN *.*') do echo %%a >>filelist.txt

获取文件夹列表.bat

@echo off set dir=./ for /f "delims=" %%i in ('dir /ad/b/s "%dir%"') do (echo %%i >>dirlist.txt) pause



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3