putnam / binmerge

Tool to merge multiple bin/cue tracks into one. Great for redump.
GNU General Public License v2.0
340 stars 44 forks source link

Relative paths don't work #7

Closed acrash closed 4 years ago

acrash commented 4 years ago

Hi, I was trying to create a batch file in order to use your script quickly. The batch file and the file [binmerge.py] are in the folder "C:\binmerge\" My bin files are in "C:\binmerge\Bins\" and I made a new folder "C:\binmerge\Merged\"

(Not working) This is the content of the .bat Batch file: for /r %%i in (*.cue) do binmerge.py "%%i" "%%~ni.merged" -o "%~dp0\Merged\"

But it works with: for /r %%i in (*.cue) do binmerge.py "%%i" "%%~ni.merged" -o "C:\binmerge\Merged\"

putnam commented 4 years ago

Your problem lies in your use of %~dp0. This must be dealt with by your batch script. Your script is calling python with broken arguments as a result.

https://stackoverflow.com/questions/3160058/how-to-get-the-path-of-a-batch-script-without-the-trailing-backslash-in-a-single

You can just put a trailing . after it to fix it I guess.

Try this instead: for /r %%i in (*.cue) do binmerge.py "%%i" "%%~ni.merged" -o "%~dp0.\Merged"

acrash commented 4 years ago

Thank you man (for your response and for the program) I'm an absolute idiot. Sorry if I wasted your time

On Sat, Feb 29, 2020 at 10:01 AM Chris Putnam notifications@github.com wrote:

Closed #7 https://github.com/putnam/binmerge/issues/7.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/putnam/binmerge/issues/7?email_source=notifications&email_token=AOWBLUIORACCPAHA4IG65HLRFCZGFA5CNFSM4K6JWY5KYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOW7MZFLI#event-3084489389, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOWBLUMHGA5HIOHLH4CINFDRFCZGFANCNFSM4K6JWY5A .