I use this to convert all the files in a folder to all lower case.
for /o:n %a in (*.mp4 *.mkv) do (ren "%a" "%@lower[%a]")
99% of the time it works perfectly , but every once in a while it randomly deletes the extension of a file. I just ran it on a folder containing 35 files and it deleted the extension of 3 of the files.
Thats a good question. Maybe it's really a timing problem (file is locked yet or something like that). I had - not the same - but also weird behavior some years ago through timing problems with a sync process (via TCC) with an external drive) with setting of attributes (archive). But I could solve it with a little "delay" (added /G param for the command to display the percent progress - that was enough already). I had no problem over similar task with the native command line (CMD). Also possible is that an security software (AV scanner) has influence. I could never find out the REAL problem behind (also not analyzed long).
So, I am not sure if that is really a bug - for me it sounds more like problem as I described above. BUT I AM NOT SURE ABOUT!
Here, I tested with your command line with 45 files (multiple times) - was all correct.
However: annoying such things, I know!
PS: Technically, I would say: it does not a basically delete the suffix - instead it can't finish the process of renaming. The end result is the same of course.
Is there anything peculiar about the names of the files that lose their extension? What happens if you repeat the experiment with a copy of the same set of files; are the same ones affected? You might try repeating the experiment alternating between @LOWER and @UPPER.
I tried with a few hundred files, several times, using your command verbatim, and got no misbehavior.
Is there anything peculiar about the names of the files that lose their extension? What happens if you repeat the experiment with a copy of the same set of files; are the same ones affected? You might try repeating the experiment alternating between @LOWER and @UPPER.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.