Results 1 to 7 of 7

Thread: Anyone here good at .BAT files?

  1. #1
    Almost in control. autopilot's Avatar
    Join Date
    Dec 2004
    Location
    Region 2
    Posts
    4,071
    Thanks
    51
    Thanked
    12 times in 11 posts

    Anyone here good at .BAT files?

    Due to a 'bug' in Exact Audio Copy, I need a batch file to rename and sort some files for me.

    Here's the deal;

    I have a folder with lots of files. The files are in pairs, with different extentions.

    For example, in the folder i have;

    Coldplay - X&Y.cue
    Coldplay - X&Y.flac.flac
    Bonobo - Dial M For Monkey.cue
    Bonobo - Dial M For Monkey.flac.flac
    Tom Middleton - The Trip CD1.cue
    Tom Middleton - The Trip CD1.flac.flac
    ...

    What i need to do is have a batch file that renames all the files that have the extention .flac.flac so they have the extention .flac

    Also, now here's the tricky bit, i would like the batch file to take the name of each file and generate a folder with the same name. Then move both files with the same name (.cue & .flac) into that folder.

    Example;

    D:\music\Coldplay - X&Y.flac.flac becomes D:\music\Coldplay - X&Y\Coldplay - X&Y.flac

    The .cue does not need renaming but needs to be moved to the same folder as the .flac file.

    This needs to loop and do all the files in the folder. Anyone reckon they can do it?

  2. #2
    blueball
    Guest
    Have you had a look at Bulk File Renamer?

    Very powerful and (the last time I looked) was free.

    Find out more at:

    http://www.bulkrenameutility.co.uk/Main_Intro.php

  3. #3
    Gaarrrrr! Dav0s's Avatar
    Join Date
    Aug 2005
    Location
    Bristol
    Posts
    1,442
    Thanks
    1
    Thanked
    3 times in 3 posts
    hmm, i get the feeling that you may need the use of variables to name the folders the same as filenames. im actually not sure about renaming the flac files either, as again it requires set rules which u cant really apply to multiple items. maybe somebody can come up with a method along the lines of..

    rename *flac.flac *.flac

    that wdnt work btw, do you know any other programming languages?

  4. #4
    Time for Walkies... Atomic's Avatar
    Join Date
    Apr 2004
    Location
    Norfolk, UK
    Posts
    1,959
    Thanks
    0
    Thanked
    0 times in 0 posts
    VBScript is prob your best bet.

    Have a look at Scripting.FileSystemObject

  5. #5
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts
    MSH

    using the (public beta) Microsoft SHell it would be very possible.

    MSH is the new cmd.
    throw new ArgumentException (String, String, Exception)

  6. #6
    Almost in control. autopilot's Avatar
    Join Date
    Dec 2004
    Location
    Region 2
    Posts
    4,071
    Thanks
    51
    Thanked
    12 times in 11 posts
    It's completely posible with a .BAT file. It's just been years since i played with them.

  7. #7
    Senior Member
    Join Date
    Feb 2004
    Posts
    888
    Thanks
    0
    Thanked
    32 times in 29 posts
    Open basic macro for OOo Office 2.0 - because that's what I've been messing around with recently

    Original files in D:\Music\Source\

    Sub FixFlacFiles
    Dim sNextFile As String
    Dim sNewFile As String
    Dim sSourceFile As String
    Dim sTargetFile As String
    Dim sNewFolder As String
    Dim iX As Integer
    Dim iY As Integer
    sNextFile = Dir("D:\Music\Source\", 0)
    While sNextFile <> ""
    sSourcefile = "D:\Music\Source\" + sNextfile
    iX = InStr(sNextFile, ".flac.flac")
    If iX>0 then
    Mid(sNextfile, iX, Len(".flac.flac"), "")
    sNewFolder = "D:\Music\Target\" + sNextfile + "\"
    MkDir(sNewFolder)
    sTargetFile = sNewFolder + sNextfile + ".flac"
    End If
    iY = InStr(sNextFile, ".cue")
    If iY>0 then
    Mid(sNextfile, iY, Len(".cue"), "")
    sNewFolder = "D:\Music\Target\" + sNextfile + "\"
    MkDir(sNewFolder)
    sTargetFile = sNewFolder + sNextfile + ".cue"
    End If
    If iX>0 or iY>0 then
    Filecopy sSourceFile , sTargetfile
    End If
    sNextFile = Dir
    iX=0
    iY=0
    Wend
    End Sub

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 14
    Last Post: 08-10-2005, 07:09 PM
  2. Good digital photo magazine
    By Flibb in forum Consumer Electronics
    Replies: 2
    Last Post: 09-09-2005, 11:35 PM
  3. GOOD BF 2 servers.
    By Nick in forum Gaming
    Replies: 12
    Last Post: 20-07-2005, 09:28 AM
  4. Heaven: Not so good??
    By BEANFro Elite in forum General Discussion
    Replies: 62
    Last Post: 11-07-2005, 04:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •