Need Help Writing Batch File
#1
Thumbs Up 
I have looked and couldn't find what suited my needs. I'm hoping to get help here.

I was using Ember Media, and didn't check off folder.jpg in the settings and being the stickler I am for uniformity, I need help writing a batch file that will go through my folders copy the poster.jpg file and rename it folder.jpg. Below is a look at my structure:

Quote: c:\Videos\Movie1\poster.jpg
c:\Videos\Movie2\poster.jpg
c:\Videos\Movie3\poster.jpg

I need the batch file to scan the movie folders and copy the poster.jpg and rename it folder.jpg, so it should look like this after the batch file is run.

Quote:c:\Videos\Movie1\poster.jpg , folder.jpg
c:\Videos\Movie2\poster.jpg , folder.jpg
etc...

So in the end I should have two files in each folder. I hope I explained it well enough for the community to help me.
Advice on Hardware
PC-LUXA2 CPU-AMD Phenom II X6 1100T RAM-12GB Video Card-AMD Radeon HD 6800
OS-Win7 32bit - Kodi - 14.0 Helix SKIN - Aeon MQ 5 Keyboard - DiNovo Mini

-Semper Fi
gyrene2083
Reply
#2
Couldn't you just rename them all using BulkRenameUtility?
Reply
#3
I'm not sure that would scan all the content in all of the folders, and copy the poster.jpg and rename it folder.jpg.
Advice on Hardware
PC-LUXA2 CPU-AMD Phenom II X6 1100T RAM-12GB Video Card-AMD Radeon HD 6800
OS-Win7 32bit - Kodi - 14.0 Helix SKIN - Aeon MQ 5 Keyboard - DiNovo Mini

-Semper Fi
gyrene2083
Reply
#4
I'm not at a computer right now, but what you are after is a "for, in, do" batch file. A quick google should turn up some examples.
-stoli-
Reply
#5
@stoli,

So I did the google search and this is what I came up with.
Code:
For /r e:\dummymovies %%X in (*.jpg) do copy /y poster.jpg folder.jpg

Needless to say it's not working and I can't figure out why. I know your not at your pc but am I at least on the right track?
Advice on Hardware
PC-LUXA2 CPU-AMD Phenom II X6 1100T RAM-12GB Video Card-AMD Radeon HD 6800
OS-Win7 32bit - Kodi - 14.0 Helix SKIN - Aeon MQ 5 Keyboard - DiNovo Mini

-Semper Fi
gyrene2083
Reply
#6
Thumbs Up 
Ok so I wanted to thank Hitcher for recommending the bulkrenameutility. Although it didn't do what I needed that program does rock. Thanks Hitcher.

I also wanted to thank Stoli for pointing me in the right direction. I googeled and searched all night and found a site that helped called computing.net and here is the batch code that finally worked.

Code:
@echo off & setlocal
    cd /D E:\dummymovies
    for /R  %%j in (.) do if exist "%%j\poster.jpg" copy "%%j\poster.jpg" "%%j

\folder.jpg"

    "
pause

So, the mods can close this thread out thanks again.
Advice on Hardware
PC-LUXA2 CPU-AMD Phenom II X6 1100T RAM-12GB Video Card-AMD Radeon HD 6800
OS-Win7 32bit - Kodi - 14.0 Helix SKIN - Aeon MQ 5 Keyboard - DiNovo Mini

-Semper Fi
gyrene2083
Reply
#7
Glad you got it sorted and BulkRenameUtility's a great thing to have.
Reply

Logout Mark Read Team Forum Stats Members Help
Need Help Writing Batch File0