1.

Solve : The Ren Command Glitch??

Answer»

If I create a file LIKE this ...

"my.bla.JPG"

And then use the command ...

"ren *.jpg.bla *.jpg"

The file in the end looks like this ...

"my.jpg.jpg"

What is this? It should be "my.jpg" no? Could it be a DOS glitch??!Wit hthe file names and commands the rename command issues a "The system cannot find the file specified" error.

If you are talking about pure dos, Files follow the 8.3; up to 8 characters for the filename, up to 3 for the extension. A file MAY not have more than one extension in 'pure' DOS environments.Quote from: guideX on April 30, 2013, 11:21:31 PM

If I create a file like this ...

"my.bla.jpg"

And then use the command ...

"ren *.jpg.bla *.jpg"

You are mistaken. Some thing else happened while you were testing.

d:\abc>dir /b
my.bla.jpg

d:\abc>ren *.jpg.bla *.jpg
The system cannot find the file specified.
Quote from: guideX on April 30, 2013, 11:21:31 PM
If I create a file like this ...

"my.bla.jpg"

And then use the command ...

"ren *.jpg.bla *.jpg"

Surely you meant
file like this ...

"my.jpg.bla"

which then matches the filespec for the rename.
This behaviour is not a glitch, the filename is my.jpg, the extension is .bla

to rename it the way you want, simply rename it without an extension, thus

ren *.jpg.bla *.
now the .jpg from the name is PROMOTED to the extension

simples
Whoops! Let me CORRECT my experiment, and give a little more information.. I'm using Windows 7 64bit cmd.


1) Create a file, called m.txt.bla
2) Type ren *.txt.bla *.txt (logically, you should have a file m.txt)
3) You now have a file called m.txt.txt

To me this make little sense, and I'd suggest it's a glitch.
I did encounter it as working when you use ren *.jpg.bla *. however, this also seems like a glitch ... If I did this command, wouldn't I end up with a file called "my."?

Quote from: gpl on May 01, 2013, 05:05:57 AM
Surely you meant
file like this ...

"my.jpg.bla"

which then matches the filespec for the rename.
This behaviour is not a glitch, the filename is my.jpg, the extension is .bla

to rename it the way you want, simply rename it without an extension, thus

ren *.jpg.bla *.
now the .jpg from the name is promoted to the extension

simples
Quote from: guideX on May 01, 2013, 06:38:47 PM
I did encounter it as working when you use ren *.jpg.bla *. however, this also seems like a glitch ... If I did this command, wouldn't I end up with a file called "my."?
no, its not a glitch, the extension follows the last dot - the name of the file is my.jpg, the filetype is bla


Discussion

No Comment Found