Jump to content

How to adjust this batch file


h0l0cr0n

Recommended Posts

Hello i have been using these 2 batch files (didnt make them myself, obviously ^^ i dont understand 99% of how this works, but it does the job) to convert bluray folders to isos and then delete the folders after. 
But it puts the isos on the same drive, and id like to change the path where it stores the isos.
Hope you guys can help me out

the first:
@echo off@echo off
if exist makeiso.err erase/q makeiso.err
if exist makeiso.log erase/q makeiso.log
set DIRS=%1
if not defined DIRS set DIRS=*
set MakeIsoBatch=yes
for /d %%i in (%DIRS%) do @call "z.BAT" "%%~i" %2
set MakeIsoBatch=
if exist makeiso.err erase/q makeiso.err

the second:

@echo off
set PathToImgBurn="F:\PORTABLES\IMGBURN\ImgBurn.exe"
if exist %PathToImgBurn% goto FndImgBurn
set PathToImgBurn="F:\PORTABLES\IMGBURN"
if exist %PathToImgBurn% goto FndImgBurn
echo Can't locate imgburn
echo Can't locate imgburn >>makeiso.log
goto:eof
:FndImgBurn
set SRC=%1
set DEST=%2
rem echo Debug ARG1=%1 ARG2=%2 SRC=%SRC% DEST=%DEST%
if defined SRC goto HasArgs
echo MakeIso1: Makes ISO from (Blu-Ray) Folder
echo syntax: makeiso1 source-folder-to-convert-to-iso [destination-folder]
goto:eof
:HasArgs
set FolderNameOnly=%~nx1
if not defined MakeIsoBatch goto BatchOk
if not exist makeiso.err goto BatchOk
echo %SRC% skipped folder due to previous error
echo %SRC% skipped folder due to previous error >>makeiso.log
goto:eof
:BatchOk
if exist %SRC% goto SrcOk
echo %SRC% not found
echo %SRC% not found >>makeiso.log
goto:eof
:SrcOk
if exist %SRC%\BDMV goto BDMVOk
echo %SRC%\BDMV not found - not a Blue-Ray disc
echo %SRC% not found - not a Blue-Ray disc >>makeiso.log
goto:eof
:BDMVOk
if defined DEST set DEST=%~2\
set DEST="%DEST%%FolderNameOnly%.ISO"
rem Uncomment the following line (remove "rem") if any existing .ISO is to be removed.
rem if exist %DEST% erase/q %DEST%
if not exist %DEST% goto DestOk
echo %DEST% exists - skipping
echo %DEST% exists - skipping >>makeiso.log
goto:eof
:DestOk
echo Converting %SRC% to %DEST%
echo Converting %SRC% to %DEST% >>makeiso.log
rem goto IsoExists
%PathToImgBurn% /MODE BUILD /BUILDMODE IMAGEFILE /SRC %SRC% /DEST %DEST% /FILESYSTEM "UDF" /UDFREVISION "2.50" /VOLUMELABEL "%FolderNameOnly%" /CLOSE /NOIMAGEDETAILS /ROOTFOLDER "YES" /START
rem could test for %ERRORLEVEL% but seems to be zero even when errors occur (empty BDMV)
if exist %DEST% goto IsoExists
echo %DEST% doesn't exist
echo %DEST% doesn't exist >makeiso.err
goto:eof
:IsoExists
rem Uncomment the following line (remove "rem") if source folder is to be removed upon successful completion.
@rmdir/q/s %SRC%

Edited by h0l0cr0n
Link to comment
Share on other sites

A little more explanation please as to how this BAT scenario works.  When it's run, do you type in a path/folder to save the ISO's to?

 

I'll do my best, but, it's been well like 15 years since I last did any batch programming.

Link to comment
Share on other sites

I start it up in a folder with a lot of bluray folders i want to make in to isos. (it will skip everything but bdmv stuff)
then it will make all folders in to isos, but the isos get placed in that folder too. :( 
i would like to change that if its possible, but i got this from a forum no idea how it works

Link to comment
Share on other sites

Now, I'm not entirely sure, but I think if you change the following line

set DEST="%DEST%%FolderNameOnly%.ISO"

to

set DEST="C:\%FolderNameOnly%.ISO"

 

then the ISO's will be saved in a root directory on C:\  So change C:\ to whatever drive and path you want to save the ISO's to.

 

I'm not entirely sure of the logic here, but I think that's what you're looking for.

Link to comment
Share on other sites

Well, it would, of course, depend on what the source drive is and what the target drive is.  For instance, if the target is an SSD, it will write faster than if the source was used as the target and the source was a mechanical HDD.  Plus, if you're using the same source as the target, there will be slow down in writing because the device is having to do both reading, processing, and writing all simultaneously.  But, generally, yeah, you'll get faster processing if you're using different devices for the source and the target.

Link to comment
Share on other sites

It looks like you’re meant to pass DEST as the 2nd command line argument.

Of course, that isn’t possible by simply double clicking the bat file, you need to call it via something like this.

Makeiso “c:\src” “d:\dest”

Hardcoding the value, as suggested by dbminter, is therefore the way to go for you, but it kills off command line functionality.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.