中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 00:05
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Can such batch renaming make the end of the file name an increasing sequence?
Printable Version  2,846 / 23
Floor16 churui007 Posted 2010-08-09 09:44
新手上路 Posts 12 Credits 12
It's just that I don't have time to type such a long thing. I'm working on VBS form cracking. Otherwise, shall we change it?
And what I provided at the beginning was just a question. There's no sneering or sarcasm. If using a metaphor counts as sneering and sarcasm, then just suggest that those who study language cancel the figure of speech of metaphor.
The things you said later made me feel that you were not friendly. You just said the method. Look at what you wrote at the end. Sure enough, it's my own fault for talking too much.

[ Last edited by churui007 on 2010-8-9 at 09:54 ]
Floor17 laineve Posted 2010-08-09 22:24
新手上路 Posts 18 Credits 18
There's no way, infants always have a growth period
Floor18 laineve Posted 2010-08-09 22:27
新手上路 Posts 18 Credits 18
Floor 16 is just being mouthy, pretending to understand when they don't! You can't use a metaphor like that. The analogy of father and son between peers in China is only used sarcastically.
Floor19 laineve Posted 2010-08-09 22:31
新手上路 Posts 18 Credits 18
Don't talk to me about VBS. If it takes more than 5 minutes to do something as simple as you said, even if you were to clean the toilet, you wouldn't get anything meaningful done
Floor20 laineve Posted 2010-08-09 22:32
新手上路 Posts 18 Credits 18
You have time to write so many words here with me, browse the forum, will there be no time? It has to be someone who believes it when you say it
Floor21 wangyang331407 Posted 2010-08-09 22:34
初级用户 Posts 28 Credits 28
I have studied it again as per your request. The following should solve your problem.
@echo off
setlocal enabledelayedexpansion
set num=0
for /f "delims=." %%i in ('dir /a-d /b *.txt') do (
set /a num+=1
ren "%%i.txt" "!num!%%i.txt"
)
pause & exit
Floor22 wangyang331407 Posted 2010-08-09 22:40
初级用户 Posts 28 Credits 28
Oh, don't have a war of words anymore. Endure for a while and there'll be peace and quiet, step back and there'll be room to breathe. Harmony is precious, harmony is precious.
Floor23 slore Posted 2010-08-10 13:00
铂金会员 Posts 2,478 Credits 5,212
Originally posted by wangyang331407 at 20008-9 22:34:
After following your requirements and researching again, the following should solve your problem.
@echo off
setlocal enabledelayedexpansion
set num=0
for /f "delims=." %%i in ('dir /a-d /b *.t ...



Take a look at the code on floor 15. There are still major defects when you use the dot to split. What about a.test.txt? And what about the result with spaces...

Since for has the %~nI extension, just use it directly.
Floor24 wangyang331407 Posted 2010-08-10 22:44
初级用户 Posts 28 Credits 28
I tried the one on the 15th floor. After running, that window flashed by very powerfully.
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023