This is what I saw on the GOOGLE group, and I sent it here for everyone to study. Although it has great limitations, you can take a look.
Mainly to remove the 0 before the file name
Before processing:
0000001.txt 00000010.txt 00000011.txt
00000012.txt 00000013.txt 00000014.txt 00000015.txt 00000016.txt
00000017.txt 00000018.txt 00000019.txt 0000002.txt 00000020.txt
0000003.txt 0000004.txt 0000005.txt 0000006.txt 0000007.txt
0000008.txt 0000009.txt
After processing:
1.txt 10.txt 11.txt 12.txt 13.txt
14.txt 15.txt 16.txt 17.txt 18.txt 19.txt 2.txt
20.txt 3.txt 4.txt 5.txt 6.txt 7.txt 8.txt
9.txt
Mainly to remove the 0 before the file name
Before processing:
0000001.txt 00000010.txt 00000011.txt
00000012.txt 00000013.txt 00000014.txt 00000015.txt 00000016.txt
00000017.txt 00000018.txt 00000019.txt 0000002.txt 00000020.txt
0000003.txt 0000004.txt 0000005.txt 0000006.txt 0000007.txt
0000008.txt 0000009.txt
After processing:
1.txt 10.txt 11.txt 12.txt 13.txt
14.txt 15.txt 16.txt 17.txt 18.txt 19.txt 2.txt
20.txt 3.txt 4.txt 5.txt 6.txt 7.txt 8.txt
9.txt
@echo off
for /f "delims=" %%a in ('dir/b *.txt') do call :next %%a
echo Finish...
goto :eof
:next
set pp=%1
:loop
if %pp:~0,1%==0 set pp=%pp:~1%& goto :loop
ren %1 %pp%
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| redtek | +5 | 2006-12-07 22:46 |
我今后在论坛的目标就是做个超级坏人!!!
