Originally posted by bjsh at 2007-4-13 10:10 PM:
Create a 10.pdf in the C drive.
Execute the following two commands;
See what 10.pdf is renamed to in the end/
ren 10.pdf *2.c
The result is: 10.pdf2.c
ren 10.pdf *1.c
The result is 1.c
ren 10.pdf *2.c
What is the first character after *?
2
Is there this character in 10.pdf?
No. So, it is appended at the end
10.pdf
2.c
10.pdf2.c
ren 10.pdf *1.c
What is the first character after *?
1
Is there this character in 10.pdf?
Yes. Find the first one from the end, and align
10.pdf Delete after 1
1.c Append after 1
1.c
ren 10010.pdf *1.c
What is the first character after *?
1
Is there this character in 10010.pdf?
Yes. Find the first one from the end, and align
10010.pdf Delete after 1
1.c Append after 1
1001.c
Special case ren * *.
ren * "* "
FAT32
C:\TEST>cd.>123...456...789.mp3
C:\TEST>dir/b
123...456...789.mp3
C:\TEST>ren * *.
C:\TEST>dir/b
123...456...789
C:\TEST>ren * *.
C:\TEST>dir/b
123
---
C:\TEST>cd.>"123 456 789.mp3"
C:\TEST>dir/b
123 456 789.mp3
C:\TEST>ren * "* "
C:\TEST>dir/b
123
C:\TEST>for %a in (*) do @echo "%a"
"123"
NTFS
D:\TEST>cd.>123...456...789.mp3
D:\TEST>dir/b
123...456...789.mp3
D:\TEST>ren * *.
D:\TEST>dir/b
123...456...789
D:\TEST>ren * *.
D:\TEST>dir/b
123...456
D:\TEST>ren * *.
D:\TEST>dir/b
123
---
D:\TEST>cd.>"123 456 789.mp3"
D:\TEST>dir/b
123 456 789.mp3
D:\TEST>ren * "* "
D:\TEST>dir/b
123 456
D:\TEST>for %a in (*) do @echo "%a"
"123 456"
D:\TEST>ren * "* "
D:\TEST>dir/b
123
D:\TEST>for %a in (*) do @echo "%a"
"123"
[ Last edited by mkd on 2008-4-28 at 05:42 PM ]
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| gool123456 | +1 | 2010-05-01 20:24 |
