China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-10 10:02
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to batch rename extensions using batch processing? View 2,138 Replies 12
Original Poster Posted 2008-11-05 18:47 ·  中国 福建 福州 电信
初级用户
Credits 52
Posts 36
Joined 2008-10-10 18:24
17-year member
UID 128013
Gender Male
Status Offline
How to batch rename files with the extension "*.rar.重命名" to "*.rar" using batch processing?
Floor 2 Posted 2008-11-05 19:02 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
REN *.RAR.重命名 *.rar

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 3 Posted 2008-11-05 19:03 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
copy *.RAR.重命名 *.rar

copy *.RAR.rename to *.rar
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
JamesYou +2 2008-11-05 19:25

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 4 Posted 2008-11-05 19:15 ·  中国 福建 福州 电信
初级用户
Credits 52
Posts 36
Joined 2008-10-10 18:24
17-year member
UID 128013
Gender Male
Status Offline
LS的,copy不是复制命令吗?

LS de, copy bu shi fu zhi ming ling ma?

Wait, "LS" here might be a typo or specific term in the context. But based on the content, the translation of the Chinese part "copy不是复制命令吗?" is "copy isn't the copy command?" So the whole thing is:

LS的,copy不是复制命令吗?

LS de, copy isn't the copy command?
Floor 5 Posted 2008-11-05 19:28 ·  中国 福建 福州 电信
初级用户
Credits 52
Posts 36
Joined 2008-10-10 18:24
17-year member
UID 128013
Gender Male
Status Offline
REN *.RAR.重命名 *.rar
Why doesn't it work?
Floor 6 Posted 2008-11-05 19:36 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Don't just say why it doesn't work. Tell me where you executed the command, how you executed it, what error message you got, and you can also paste a screenshot.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
HAT +2 2008-11-05 19:47

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 7 Posted 2008-11-05 19:36 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Originally posted by JamesYou at 2008-11-5 19:15:
LS, isn't copy the copy command?



It can also be used to rename through this command.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 8 Posted 2008-11-05 19:55 ·  中国 江西 赣州 安远县 电信
银牌会员
★★★★
Credits 2,025
Posts 1,122
Joined 2007-09-05 20:15
18-year member
UID 96653
Gender Male
Status Offline
Originally posted by yishanju at 2008-11-5 07:36 PM:

You can also use this command to rename.

No! You must not use ren. Just use move. move is okay, but copy is not.
However, the renaming with move does not support wildcards.

[ Last edited by tireless on 2008-11-5 at 19:59 ]
Floor 9 Posted 2008-11-05 20:00 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
...

I have tried it on the XP system.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 10 Posted 2008-11-05 20:08 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
C:\Documents and Settings\haige\Desktop>copy *.txt *.txt2
cn-dos.txt
QQ.exe.txt
Network Management Software.txt
3 files copied.



Directory of C:\Documents and Settings\haige\Desktop

008-10-28 15:16 917 cn-dos.txt2
008-11-05 19:40 251,180 QQ.exe.txt2
008-11-04 09:55 323 Network Management Software.txt2
3 File(s) 252,420 bytes
0 Dir(s) 23,787,970,560 bytes free

Delete the original files, doesn't that mean you can use this command to rename?

[ Last edited by yishanju on 2008-11-5 at 20:09 ]

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 11 Posted 2008-11-05 22:04 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Is it a bit of a waste of resources if a 10GB file is renamed using this method?
Floor 12 Posted 2008-11-05 22:12 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
It depends on the situation and actual needs, right?

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 13 Posted 2008-11-05 22:43 ·  中国 四川 成都 电信
初级用户
★★
Credits 118
Posts 66
Joined 2006-08-18 16:04
19-year member
UID 60797
Gender Male
Status Offline
Here's the translation:

Here's a batch script I made that might be useful


@ECHO OFF
color 0A
setlocal ENABLEDELAYEDEXPANSION
title Batch rename image (jpg) filenames in current directory!
echo.
echo.
echo ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
echo Batch rename image (jpg) filenames in current directory!
echo ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
echo.
set fhz=jpg
SET NO=0
set namet=
SET /P namet=Please choose and enter the filename prefix:
FOR /F %%i IN ('dir /b *.%fhz%') DO (
SET /A NO+=1
REN %%i %namet%!NO!.%fhz%
)
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
echo Filename renaming completed.....Press any key to exit
echo ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pause>nul
Forum Jump: