Need help with a script please
Posted: October 31st, 2009, 5:04 am
Currently, I use a script to move files out of the folders they are in to the parent directory.
EXAMPLE:
D:\TV\New Shows\Supernatural.s05e05.xvid\Supernatural.s05e05.xvid.aviĀ to
D:\TV\New Shows\Supernatural.s05e05.xvid.avi
The reason for this is I use another program that monitors that folder for new shows and moves them into their series/season folders and gathers all available metadata for them. The problem is, if the show resides in a subfolder, the program thinks it is a new "series" and doesn't move it. So I use a post processing script that looks like this:
This script works great, but the only problem is if a show doesn't happen to get downloaded in a subfolder like the example, the show gets moved into the main directory(D:\TV) and the program doesn't see it then either. Also, the "new shows" folder gets deleted.
So what I want, is something extra in the script, possibly a "IF" parameter? That checks to see if the parent directory is "New Shows" and if so, to not move the file and exit the script, but if the directory is not new shows, to complete the script.
I've tried adding
But that doesn't seem to work, possibly my syntax is off, can someone provide some pointers?
EXAMPLE:
D:\TV\New Shows\Supernatural.s05e05.xvid\Supernatural.s05e05.xvid.aviĀ to
D:\TV\New Shows\Supernatural.s05e05.xvid.avi
The reason for this is I use another program that monitors that folder for new shows and moves them into their series/season folders and gathers all available metadata for them. The problem is, if the show resides in a subfolder, the program thinks it is a new "series" and doesn't move it. So I use a post processing script that looks like this:
Code: Select all
@echo off
cd /D "%1"
ren *.avi %1.avi
move *.avi ..
cd ..
rd /S /Q %1
So what I want, is something extra in the script, possibly a "IF" parameter? That checks to see if the parent directory is "New Shows" and if so, to not move the file and exit the script, but if the directory is not new shows, to complete the script.
I've tried adding
Code: Select all
@echo off
cd /D "%1"
IF %1 == New Shows (exit) Else (
ren *.avi %1.avi
move *.avi ..
cd ..
rd /S /Q %1)