Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Need help with a rename bat file from an expert, please help.  (Read 1908 times)

0 Members and 1 Guest are viewing this topic.

abispac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1625
  • Last login:July 24, 2025, 12:57:01 am
Need help with a rename bat file from an expert, please help.
« on: January 19, 2012, 10:39:25 pm »
Ok heres my stuation, im in the process to rename and tag all of my music collection, taggin, not a problem, organising music, not a problem , it took me like a month to organise music from this:
c:\music\english\artist\artist-album name
to this
c:\music\english\artist\album name
Cool, not a problem, everything should be fine, the problem came that i really like a nice piece of jukebox software that works just fine on old computers, and also its very simple, software its made on Bolivia.
And it happens that reads and organises the music by the folder names, not by the mp3 tags, so when i build my music lybrary instead of getting the artis and the album name displayed, i get only the album name wich makes things a mess, so i need to go back to the c:\music\english\artist\artist-album name type so i can use this particular piece of software so heres my petition:
Is it posible to make a bat file that can rename subfolders and adds the name of their parent folder only so i can save a month of work.
Say i got
c:\music\the doors\hotel california
c:\music\the doors\hits
c:\music\the doors\five to one

and with the help of the bat file i can get somenthing like:
c:\music\the doors\the doors -hotel california
c:\music\the doors\the doors -hits
c:\music\the doors\the doors -five to one

if is posible , please share the solutions, thanks for any help offered.

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Need help with a rename bat file from an expert, please help.
« Reply #1 on: January 20, 2012, 08:04:51 pm »
I rarely use batch files, I tend to use autohotkey to solve these problems. I have a solution that works for you if you want to do that. Download and install autohotkey if you don't already have it. Put the following into a file with the extension .ahk

Quote
Loop *,,1
{

StringSplit, array, A_LoopFileLongPath, \

FileMove, %A_LoopFileLongPath%, %array1%\%array2%\%array3%\%array3% -%A_LoopFileName%
}
msgbox Finished!

Place that file in C:\music

Run it and when it's finished you will have exactly what you're after. :cheers:

This assumes that everything is structured just like you said in your example. There should be no other files or folders in the albums folders other than the mp3s or you'll get a bunch of stuff renamed that you may not want renamed. Also, before running it you should be sure that no album names have characters in them that would not be allowed in a filename for obvious reasons. I'm not sure what would happen in that case.

I don't forsee any problems, however, whenever I offer someone something that is going to do stuff with files, I always advise them to back all those files up first in case something goes haywire.

Let me know if you try this and if it works for you!

abispac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1625
  • Last login:July 24, 2025, 12:57:01 am
Re: Need help with a rename bat file from an expert, please help.
« Reply #2 on: January 20, 2012, 08:29:04 pm »
Thanks alot, i really apreciate your help, but it looks a bit risky and i do not have the space to back up 700 gb, so i might have to work this by hand again.... thanks again  :cheers:

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Need help with a rename bat file from an expert, please help.
« Reply #3 on: January 20, 2012, 09:54:07 pm »
Didn't realize it was 700 GB :o I don't blame you for being a little nervous then. I wouldn't really know how to do this properly with a batch file, so hopefully someone else can help you.

If no one steps up, I suppose you could test this by just copying 3 or 4 folders to C:\music2 and trying it there and see if you get the results you want. I tested it a bit and it should work fine as long as the album folders are in C:\folderName. The absolute worst that could really happen is something isn't quite what I expected and some files get crazy names and/or moved to another folder.

Anyway, hopefully you find a solution you like that doesn't involve renaming all that by hand. Ugh. ;)

Le Chuck

  • Saint, make a poll!
  • Wiki Contributor
  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5509
  • Last login:June 14, 2025, 06:26:06 pm
  • <insert personal text here>
Re: Need help with a rename bat file from an expert, please help.
« Reply #4 on: January 21, 2012, 12:03:51 am »
I have had really good luck with Advanced Renamer in the past.  I would recommend that you give it a try.  It has several settings for renaming folders.  You can set up some fairly advanced rule sets but play with it first before you commit to a global rule.  I think that you can easily turn months work into days or a week's work with this, but I would be wary of going whole hog until you've fleshed it out. 

abispac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1625
  • Last login:July 24, 2025, 12:57:01 am
Re: Need help with a rename bat file from an expert, please help.
« Reply #5 on: January 21, 2012, 07:39:59 pm »
Ill keep that in mind, im prett sure ill need the soft any time later, i ended up doing all by hand since it wanst that hard as it was the other way, one full day of cliking copy paste...it was tuff. thanks

Mario

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 278
  • Last login:March 29, 2021, 08:55:12 pm
  • Mmmmm.....arcades!
    • Mario's Arcade Page
Re: Need help with a rename bat file from an expert, please help.
« Reply #6 on: January 21, 2012, 10:02:17 pm »
Try this:

------------------
@echo off
cd C:\music
for /D %%G in (*) do (
   pushd "%%G"
   for /D %%H in (*) do (
      echo ren "%%H" "%%G - %%H"
   )
   popd
)

------------------

Put this in a text file with a .bat or .cmd extension (e.g., modnames.cmd). Run it first as is, and if the "ren" commands look correct, just remove the "echo" that's in red text and run it again.

The best reference I found for writing batch scripts in Windows is here: http://ss64.com/nt/

Mario
« Last Edit: January 22, 2012, 03:09:43 pm by Mario »

Thenasty

  • Trade Count: (+17)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4420
  • Last login:July 24, 2025, 06:20:12 pm
    • Thenasty's Arcademania Horizontal/Vertical monitor setup.
Re: Need help with a rename bat file from an expert, please help.
« Reply #7 on: January 23, 2012, 02:21:49 pm »
this might work but on each own folder with the same ARTIST NAME


REN *.* The Doors - *.mp3

give it a sample try.
Thenasty's Arcademania Horizontal/Vertical setup.
http://forum.arcadecontrols.com/index.php?topic=26696.0

Free VGA Breakout Cable
http://forum.arcadecontrols.com/index.php?topic=38228.0

Ultimate All in One Coin Mech write up (Make your own)
http://forum.arcadecontrols.com/index.php?topic=19200.0

abispac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1625
  • Last login:July 24, 2025, 12:57:01 am
Re: Need help with a rename bat file from an expert, please help.
« Reply #8 on: January 26, 2012, 10:57:02 pm »
Try this:

------------------
@echo off
cd C:\music
for /D %%G in (*) do (
   pushd "%%G"
   for /D %%H in (*) do (
      echo ren "%%H" "%%G - %%H"
   )
   popd
)

------------------

Put this in a text file with a .bat or .cmd extension (e.g., modnames.cmd). Run it first as is, and if the "ren" commands look correct, just remove the "echo" that's in red text and run it again.

The best reference I found for writing batch scripts in Windows is here: http://ss64.com/nt/

Mario

thanks mario ill give that a try .

abispac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1625
  • Last login:July 24, 2025, 12:57:01 am
Re: Need help with a rename bat file from an expert, please help.
« Reply #9 on: January 26, 2012, 10:58:12 pm »
this might work but on each own folder with the same ARTIST NAME


REN *.* The Doors - *.mp3

give it a sample try.
i do not want to rename mp3's , i want to rename folders only. but thanks anyway.