#1 : 20/01-18 18:54
I have tried myself for hours now.
I have a ton of folders called CLV-*** (*** is random letters)
In those folders i have a .nes , a .png file and a .desktop file
I want to change the names of the .png and .desktop files so they match the .nes file
I have tried with reg ex
(.*)\.desktop (this works)
(.*)\.nes.desktop (This does not work, it will just write (.*)\.nes.desktop)
I am new to reg exp so i'm probably doing something wrong.
I have 1400 some folders, so i can't just do one folder at a time that'd take for ages.
Hope anyone can help me. :)
also tried to search for
I could use dir name, if there was any way to copy contents of folder into a new folder and name that folder whatever .nes file is called. But i don't know how to do that without copying everything into their own folder instead of pairing up.
Edit: I actually don't need the .desktop file
just need to rename the png file to the same as the .nes file
20/01-18 18:54 - edited 20/01-18 19:17
#2 : 01/02-18 08:07
Although this does NOT use AR, it WILL do your job:
Copy between the rows of === and Paste into a .bat file.
:: Execute this batch from the root folder
:: which holds all the CLV-*** folders
:: I assume only one each type of file in each folder
FOR /R %%D IN (.) DO (
for /F "delims=" %%A in ('dir /b *.nes') do (
ren *.png !base!.png
ren *.desktop !base!.desktop
(I have inserted extra spacing for clarity.)
Test folders/files BEFOREHAND:
RUN the batchfile:
File Not Found <<== This verifies that you are in the root, NOT inside a CLV-xxxx Folder!
\TESTING\CLV-name\ <<== These are just to let you know
\TESTING\CLV-test\ which folder is being processed.
\TESTING\CLV-yeti\ if you don't need this output,
\TESTING\CLV-zulu\ remove the 'echo %%~pA' line from the Batchfile.
Test folders/files AFTER PROCESSING:
C:\TESTING>DIR /S /B
Which is, I think, the results that you are asking for.
It is a long post, but I think that it answers the question properly.
Hope it helps,
If this brilliant little tool has saved you time, or helped get your files in a better order, or just cleaned-up the crazy names from downloaded files, maybe you could donate a Dollar or Ten to Kim?