title
Products            Buy            Support Forum            Professional            About            Codec Central
 

How can I get other sub-folders put into converted folder?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lavir
    • May 2016
    • 6

    How can I get other sub-folders put into converted folder?

    New to forum and looking for a little help in learning. Really is a great progam.

    I have large collection of flac folders. Many contain sub-folders with artwork in them. Named "Artwork"......of course. Others with sub-folders named "Scans". Again with album booklets etc.
    When I batch convert to mp3 all works well and the folder.jpg gets added to the converted folder but the "Artwork" or the "Scan" folders do not get added to new converted folders.

    I am using [origpath]\[origfilename] in the dynamic setting.

    Thanks for any and all help.
  • Spoon
    Administrator
    • Apr 2002
    • 43926

    #2
    Re: How can I get other sub-folders put into converted folder?

    If you use the DSP effect 'Run External' you can, however it will require some knowledge of batch files. You can set it to run cmd.exe with a command line:

    /C c:\afolder\yourbatchfile.bat [infile] [outfile]

    Then in the batch file you can access the filename with %1 and %2, you could have:

    mkdir %2\..\Artwork
    copy /Y %1\..\Artwork\*.* %2\..\Artwork\
    Last edited by Spoon; 05-24-2016, 10:29 AM.
    Spoon
    www.dbpoweramp.com

    Comment

    • Lavir
      • May 2016
      • 6

      #3
      Re: How can I get other sub-folders put into converted folder?

      Originally posted by Spoon
      If you use the DSP effect 'Run External' you can, however it will require some knowledge of batch files. You can set it to run cmd.exe with a command line:

      /C c:\afolder\yourbatchfile.bat [infile] [outfile]

      Then in the batch file you can access the filename with %1 and %2, you could have:

      mkdir %2\..\Artwork
      copy /Y %1\..\Artwork\*.* %2\..\Artwork\
      Thanks Spoon.

      I was wondering if you could elaborate. I would like to give this a try.

      To test this I have done the following:

      1. I have created a .bat file and named it dbsubfolder.bat. Placed it in C:\batfile1\dbsubfolder.bat

      2. created a folder in C called "flac&artwork1" (C:\flac&artwork1) and in this I have put one folder "Testflac" (which contains the flac files and one "artwork" folder).

      C:\flac&artwork1\testflac (this is the folder I would like to convert and keep artwork folder and jpegs in it.

      3. I set the dsp effect "Run External" to C:\batfile1\dbsubfolder.bat Not sure what to put in [infile] and [outfile] or just leave it like that?

      4. Finally I'm not clear on what to put in the .bat file to point to this. If you could please clarify the path to use for these folders would be great help.

      Then hopefully I can figure out the rest and if not won't bother you any more.

      Again Thank you very much for help

      Comment

      • Spoon
        Administrator
        • Apr 2002
        • 43926

        #4
        Re: How can I get other sub-folders put into converted folder?

        In the bat file you put:

        mkdir %2\..\Artwork
        copy /Y %1\..\Artwork\*.* %2\..\Artwork\

        For run external you set to:

        program: cmd.exe (browse to it in c:\windows or windows\system)
        command line: /C C:\batfile1\dbsubfolder.bat [infile] [outfile]
        Spoon
        www.dbpoweramp.com

        Comment

        • Lavir
          • May 2016
          • 6

          #5
          Re: How can I get other sub-folders put into converted folder?

          thanks spoon.

          Entered all the above and it created an empty folder "Artwork" in my C: drive only (C:Artwork). Did not copy the files from the original "Artwork" folder located with the flac files that are being converted from the folder "flac&artwork1".

          The rest of the flac files all converted to mp3s along with the folder.jpg in the "flacoutput" folder as I had set.


          My only guess is that the copy command needs to point to my "flacoutput" folder and also be able to copy the .jpg files to it also.
          If you have a quick reply would be appreciated and I won't keep bothering you.
          Have leaned a little more though and thanks again.

          Also if this helps/clarifies these are the folders I am using to try to figure this out:

          C:batfile1 contains the .bat file "dbsubfolder.bat" with mkdir %2\..\Artwork
          copy /Y %1\..\Artwork\*.* %2\..\Artwork\

          C:flac&artwork1 contains the .flac files and a folder "artwork" containing .jpg files

          C:flacoutput that dBpoweramp is set to output my converted files too.

          And if I run just the .bat file - it does create "Artwork" for the makdir command (as above), but I get an "system cannot find the file specified" for the copy /Y %1\..\Artwork\*.* %2\.." Artwork\ command.

          Comment

          • Lavir
            • May 2016
            • 6

            #6
            Re: How can I get other sub-folders put into converted folder?

            Just to update. I have found a program called FlacSquisher (freeware) which does exactly what I have been trying to get dBpoweramp to do.
            Played with it to get the settings right and now it is converting all my Flac folders to mp3s while keeping the folder structure of my Flac folders and also keeping all the sub-folders such as "Art" "Scans" etc, their contents, and all the .jpg files that are in the Flac folders.

            Been running it for the last few hours (lots of Flac to convert) and only issue is that computer is running slower while it does its thing.

            Still I wish I could have figured out how to do this with dBpoweramp. I still like dBP and if someone could figure out how to do this with dBP would be nice.

            Thanks Spoon for for helping me give it a shot with Batch file.

            Comment

            • mville
              dBpoweramp Guru
              • Dec 2008
              • 4015

              #7
              Re: How can I get other sub-folders put into converted folder?

              In your dbsubfolder.bat file try replacing:
              mkdir %2\..\Artwork
              copy /Y %1\..\Artwork\*.* %2\..\Artwork\

              with the following:
              set InFiles=%~dp1Artwork\*.*
              set OutDir=%~dp2Artwork\

              mkdir %OutDir%
              copy /Y %InFiles% %OutDir%

              Comment

              • Lavir
                • May 2016
                • 6

                #8
                Re: How can I get other sub-folders put into converted folder?

                thanks mville. Tried it ...... no luck

                Comment

                • mville
                  dBpoweramp Guru
                  • Dec 2008
                  • 4015

                  #9
                  Re: How can I get other sub-folders put into converted folder?

                  Originally posted by Lavir
                  thanks mville. Tried it ...... no luck
                  I have just tested this on my Windows 8.1 64-bit PC and it works perfectly, when the sub-folder is named Artwork and my source folder is named flacinput and destination folder is named flacoutput. Not sure why is doesn't work for you.

                  Either I am not understanding what you are trying to do here or maybe the Output location and/or the Run External DSP settings are not set correctly.

                  Firstly, try taking the & (ampersand) out of the source folder name flac&artwork1 or rename it to flacinput and try again please.
                  Last edited by mville; 05-28-2016, 02:13 AM. Reason: added possible solutions

                  Comment

                  • Lavir
                    • May 2016
                    • 6

                    #10
                    Re: How can I get other sub-folders put into converted folder?

                    Thanks Mville. That did the trick.

                    When I rechecked every step for the setup again I found that I had misspelled one item in the "Command Line" for the DSP setting pointing to the batch file.

                    Thank you and Spoon so much for the assistance. Greatly appreciated.

                    One last request. Is there someway to have the batch file set to copy/backup every subfolder instead of just the folder named artwork
                    Reason why I ask is that some of my flac folders contain other folders such as "Scans"
                    Was wondering if there is a wildcard set for the batch file.

                    set InFiles=%~dp1Artwork\*.*
                    set OutDir=%~dp2Artwork\

                    mkdir %OutDir%
                    copy /Y %InFiles% %OutDir%
                    Last edited by Lavir; 05-28-2016, 05:47 AM.

                    Comment

                    • mville
                      dBpoweramp Guru
                      • Dec 2008
                      • 4015

                      #11
                      Re: How can I get other sub-folders put into converted folder?

                      There is a potential problem here, where the folder/filename contains the & (ampersand) character, as in your C:\flac&artwork1 example and say, if you have the Coldplay album X&Y.

                      To resolve this, try wrapping the command line parameters in quotes:
                      /C C:\batfile1\dbsubfolder.bat "[infile]" "[outfile]"

                      and use this code, which also wraps the paths in quotes:
                      set InFiles="%~dp1Artwork\*.*"
                      set OutDir="%~dp2Artwork"

                      mkdir %OutDir%
                      copy /Y %InFiles% %OutDir%

                      Comment

                      • mville
                        dBpoweramp Guru
                        • Dec 2008
                        • 4015

                        #12
                        Re: How can I get other sub-folders put into converted folder?

                        Originally posted by Lavir
                        Is there someway to have the batch file set to copy/backup every subfolder instead of just the folder named artwork
                        Reason why I ask is that some of my flac folders contain other folders such as "Scans"
                        Was wondering if there is a wildcard set for the batch file.
                        I believe this is possible, but batch file programming is not my forte. The (crude) example I have given (based on Spoon's original example code) hardcodes the Artwork folder name, but is only meant as an example to what is possible. Someone with more batch file programming experience than I, could probably code a solution in a couple of minutes.

                        There are a lot of batch file coding examples on the web, which may help you to build on what we have here.
                        Last edited by mville; 05-28-2016, 12:29 PM.

                        Comment

                        • mville
                          dBpoweramp Guru
                          • Dec 2008
                          • 4015

                          #13
                          Re: How can I get other sub-folders put into converted folder?

                          OK, I have delved further into this and may have a solution. As stated earlier, batch files are not my area of expertise, so use this code with caution. I have not tested this extensively so it may produce undesirable results.

                          Replace all code in your dbsubfolder.bat file with the following:

                          set source="%~dp1*"
                          set dest="%~dp2%%~nxF"

                          for /d %%F in (%source%) do @xcopy /s /i /y "%%F" %dest%

                          Comment

                          Working...

                          ]]>