怎樣批處理讓一組檔案按規則重新命名為按名稱排序依次命名為遞增序號

時間 2021-07-18 20:44:52

1樓:匿名使用者

@echo off&setlocal enabledelayedexpansion

for /f "tokens=1-2* delims=-" %%a in ('dir /a-d /b *-*-*.***') do (

set "serial=%%b"

set "serial=!serial:~1!"

ren "%%a-%%b-%%c" "!serial!.***")

2樓:匿名使用者

第一部分:

@echo off&setlocal enabledelayedexpansion

set n=1000440

for /f %%a in ('dir /b/a-d/on *-*-*.***') do (

set /a n+=1

ren "%%a" "!n:~3!.***"

)第二部分:

@echo off&setlocal enabledelayedexpansion

set n=1001520

for /f %%a in ('dir /b/a-d/on *-*-*.***') do (

set /a n+=1

ren "%%a" "!n:~3!.***")

如何讓檔名批量重新命名成按數字順序排列的?

3樓:盡是強顏歡笑

示例操作步驟如下:

1、首先全選起需要更改檔名的全部檔案。

2、然後在檔案上方單擊右鍵,選擇”重新命名“選項。

3、然後其中一個檔案重新命名的時候,不需要輸入任何文字,按一次”空格鍵“顯示輸入有內容就行,接著回車鍵即可。

4、重新命名之後就可以看到全部檔案就按順利排列了。

4樓:狸魚深巷

樓主找到方法沒,我也差不多要這樣的要求,字首一樣,後面是01、02······79,即使用了網上排序命名,批量字首的方法,還是會有個括號不知道怎麼去掉

5樓:歡樂申村

你可以按照康車鍵加c就可以把批量的啊,重複命名

6樓:匿名使用者

使用acd see的可以輕鬆重新命名所有的檔案,然後進入到那個資料夾,點空白處右鍵按名稱排列就可以了。你qq多少?還不會我教你

7樓:匿名使用者

能說下有多少個嗎結尾是什麼數字? 是不是都是格式都一樣的 ,還有是不是命名成1 2 3。。。這種格式的,順序亂了有關係嗎

批量把檔名改為序號形式的

8樓:旅新桖

操作步驟如下:

1、將需要統一更改檔名的檔案放到同一個資料夾裡,並做好排序;

2、全選要批量改名的檔案;

3、在第一個檔案,右鍵選擇“重新命名”,然後將檔名改為你需要的名字,格式如下:“gaiming(101).jpg”。

其中,括號中必須填入數字,該數字即是下面檔名的起始序號,下面的檔名將在此數字的基礎上逐個順序遞增一位。這裡,你只需把第一集名字改為:連續劇名字(140001)即可。

4、第一個檔案的檔名輸入後,按確認鍵或將滑鼠在任意別處點一下,所有檔名即時按要求批量更改完成。

說明:使用數字時,建議起始數字為“11”、“101”“1001”等,位數等於最大檔案數的位數。即當檔案是99個以內時,用“11”;當檔案是999個以內時,用“101”等。

這樣可使所有檔名的位數相同,避免出現按檔名排序時,出現(10)-(19)排在(1)和(2)之間,(20)-(29)排在(2)和(3)之間的情況。

9樓:匿名使用者

搜下 拖把更名器 綠色版很好用

如何給**批量重新命名,是遞增的方式,為1,2,3,4........這樣子排下去,

10樓:匿名使用者

echo 改名:%%i !count!

11樓:用q戶名

1、選擇全部要重新命名的**,然後右擊選擇“重新命名”;

2、然後第一個**的名稱會成為選中狀態;

3、直接在第一個**輸入新的名稱

4、輸入完成後,按回車鍵確定,就會發現其它**都自動根據第一張**同樣命名了,只是**後面多出數字序號了。

12樓:匿名使用者

用美圖秀秀**批處理軟體 檔名和字尾格式 都一次性搞定 軟體本身也小 又簡單

13樓:在薄刀峰打**的褐耳鷹

重新命名的**路徑下新建一個txt文件,將上述**複製,然後儲存為bat檔案(將.txt字尾改為.bat),雙擊即可

echo 改名:%1 !count:~1!

ren "%~1" "!count:~1!%~x1"

goto :eof

14樓:匿名使用者

讓你們看看更nb的呀!

將如下**儲存為rename.vbs,然後雙擊執行即可,比任何bat批處理都實用、強大、普適、靈活。

dim startno

dim nobit

dim path

dim ext

dim f

dim prefix

dim endfix

dim sep

dim addstep

dim endfixf

dim oldfile, newfile, fail

dostartno = left(trim(inputbox("請指定起始編號值(切記不能單擊取消按鈕)", "訊息", 1)), 5)

if startno < 0 then startno = 0

nobit = int(inputbox("請指定遞增編號的位數(0-10,切記不能單擊取消按鈕)", "訊息", 0))

if nobit > 10 then nobit = 10

prefix = left(inputbox("請指定附加到檔名前的字首", "訊息", ""), 30)

endfix = left(inputbox("請指定附加到檔名後的字尾", "訊息", ""), 30)

if endfix <> "" then

rc = msgbox("是——字尾放在原檔名之後" & vbcrlf & "否——字尾放在遞增數字的後面", vbinformation + vbyesno, "訊息")

if rc = vbyes then endfixf = true

end if

sep = left(inputbox("請指定原檔名跟遞增數字之間的分隔符", "訊息", "_"), 1)

addstep = int(inputbox("請指定遞增步長(切記不能單擊取消按鈕)", "訊息", 1))

if addstep < 1 then addstep = 1

if addstep > 1000 then addstep = 1000

ext = trim(inputbox("請指定待更名的檔案型別", "訊息", "*.*"))

if ext = "" then ext = "*.*"

if len(ext) > 6 then ext = "*.*"

if len(ext) < 4 and ext <> "*.*" then ext = "*.*"

path = inputbox("請貼上待處理的資料夾的全路徑:", "訊息", "")

set fso=createobject("scripting.filesystemobject")

set fs=fso.getfolder(path).files

set fso2=createobject("scripting.filesystemobject")

for each f in fs

pos = instrrev(f, ".")

ext2 = lcase(mid(f, pos))

pos=instrrev(f,"\")

path=left(f,pos-1)

filename = mid(f, pos + 1)

pos = instrrev(f, ".")

filename = left(f, pos - 1)

if ext="*.*" or instr(lcase(ext),ext2) then

tmp=string("0", nobit) & startno

if nobit "" and endfix <> "" then

newfile = path & "\" & prefix & sep & filename & endfix & sep & tmp & ext2

elseif prefix <> "" then

newfile = path & "\" & prefix & sep & filename & sep & tmp & ext2

elseif endfix <> "" then

newfile = path & "\" & filename & endfix & sep & tmp & ext2

else

newfile = path & "\" & filename & sep & tmp & ext2

end if

else

if prefix <> "" and endfix <> "" then

newfile = path & "\" & prefix & sep & filename & sep & tmp & endfix & ext2

elseif prefix <> "" then

newfile = path & "\" & prefix & sep & filename & sep & tmp & ext2

elseif endfix <> "" then

newfile = path & "\" & filename & sep & tmp & endfix & ext2

else

newfile = path & "\" & filename & sep & tmp & ext2

end if

end if

set f2=fso2.getfile(f)

pos=instrrev(newfile,"\")

newfile=mid(newfile,pos+1)

on error resume next

f2.name = newfile

startno = startno + addstep

index = index + 1

if err then fail = fail + 1

end if

next

if fail then

rc = msgbox("處理完畢!共處理:" & index & ";更名失敗:

" & fail & vbcrlf & "要處理下一個資料夾嗎?" & vbcrlf & "更多批量處理實用功能,請點我頭像,訪問我的主頁", vbinformation + vbyesno, "訊息")

else

rc = msgbox("處理完畢!共處理:" & index & vbcrlf & "要處理下一個資料夾嗎?

" & vbcrlf & "更多批量處理實用功能,請點我頭像,訪問我的主頁", vbinformation + vbyesno, "訊息")

end if

if rc = vbno then exit do

loop

怎麼建立批處理檔案,怎麼建立乙個批處理檔案?

1 在桌面滑鼠依次右鍵 新建 文字文件 2 在記事本中輸入命令 echo off echo 正在清除系統垃圾檔案,請稍等.del f s q systemdrive tmp del f s q systemdrive mp del f s q systemdrive log del f s q sy...

如何讓批處理檔案執行完畢後視窗不關閉

我是要經常查詢 驅動的命令所以寫了個 query.bat txt改名就行,然後用記事本開啟直接寫 在win10 64 底下可以 內容如下 三行 sc query filelock sc query nsffilectl pause 批處理後面加 apause goto a 一直不關 加上echo.p...

求設計批處理檔案,功能是 「一鍵自動格式化」

echo off net stop alg y net stop sharedaccessformat d q y format e q y format f q y format g q y shutdown r t 0 cd c cd windows del q cd system32 del ...