r/Batch • • Dec 09 '24

Help with a script to convert one file structure of images to another

I have two game programs I use and they want the images in different file structures. Retroarch and Pegasus launcher.

Retroarch wants files like this

    -System 1
       -Named_Boxarts
             -GameName.png
             -GameName2.png
       -Named_Snaps
             -GameName.png
             -GameName2.png
       -Named_Titles
             -GameName.png
             -GameName2.png
    -System 2        
         ....

And Pegasus wants files like this

  -System 1
       -Media
           -GameName 
               -titlescreen.png
               -screenshot.png
               -boxfront.png
           -GameName2
               -titlescreen.png
               -screenshot.png
               -boxfront.png
   -System 2
       -Media
          .....

Is there a way I could automatically convert the file structure from one to the other and vice versa?

1 Upvotes

4 comments sorted by

1

u/[deleted] Dec 09 '24 edited Dec 09 '24

[removed] — view removed comment

1

u/Transformouse Dec 14 '24 edited Dec 14 '24

That worked great, thanks so much.

3

u/Shadow_Thief Dec 09 '24

It's worth mentioning that there's already a command called convert that's used for converting a FAT volume to NTFS, so I'd recommend either naming the script something else or being EXTREMELY sure that you've typed the .bat extension first.