Hi All,
Just looking for some help with a batch script to move some files around.
Basically I have a Camera that sends .264 files to a NAS drive, I then have a little computer that converts those into .mp4 so they are easily playable from multiple devices. The problem comes with the file structure that they are so for example currently they are like this:
All I would like to do after they have been converted into .mp4 is also move them into the parent directory so it shows like:
The reason I specifically refer to the .mp4 is because I want it to ignore .264 files as it sends them to the "Record" folder and that's where Handbrake finds the files to convert... and I can't change the Camera's preset file structure.
Not sure how I can adapt the script, I have this script
Could this be adapted to move the files up? I have looked at so many different scripts and can't really get my head round this whole "%%~dpf" jazz, I understand that they link to variables like the drive name and file path but can't figure out how to adapt it to what I need.
The closest I got was:
The obvious problem with this was that every time the script was run it was moving the files up and up, which isn't what I want. I almost need it to run some sort of additional script like "If folder = record process, else ignore" If you catch my drift?
The script to search for the files to be converted is run every 10 minutes so that's I can't afford for it to be as the last. Any suggestions or solutions would be greatly appreciated!!
Just looking for some help with a batch script to move some files around.
Basically I have a Camera that sends .264 files to a NAS drive, I then have a little computer that converts those into .mp4 so they are easily playable from multiple devices. The problem comes with the file structure that they are so for example currently they are like this:
Code:
Z:\CCTV\<Date>\Record\<filename>.mp4
All I would like to do after they have been converted into .mp4 is also move them into the parent directory so it shows like:
Code:
Z:\CCTV\<date>\<filename>.mp4
The reason I specifically refer to the .mp4 is because I want it to ignore .264 files as it sends them to the "Record" folder and that's where Handbrake finds the files to convert... and I can't change the Camera's preset file structure.
Not sure how I can adapt the script, I have this script
Code:
for /R Z:\CCTV\ %%F in (*.264) do (
"..\HandBrakeCLI.exe" -i "%%~fF" -o "%%~dpF%%~nF.mp4"
if exist "%%~dpF%%~nF.mp4" (
del "%%~fF"
)
)
Could this be adapted to move the files up? I have looked at so many different scripts and can't really get my head round this whole "%%~dpf" jazz, I understand that they link to variables like the drive name and file path but can't figure out how to adapt it to what I need.
The closest I got was:
Code:
forfiles /P Z:\CCTV /s /m *.mp4 /c "cmd /c move @file .."
The obvious problem with this was that every time the script was run it was moving the files up and up, which isn't what I want. I almost need it to run some sort of additional script like "If folder = record process, else ignore" If you catch my drift?
The script to search for the files to be converted is run every 10 minutes so that's I can't afford for it to be as the last. Any suggestions or solutions would be greatly appreciated!!