Extracting CHD files

I store my CD games in .bin + .cue then in CHD files for compression. My questions are: Can I play CD audio tracks (Redbook audio) directly from CHD files? I would love that. And how can I extract .bin + .cue from CHD files? I use chdman.exe along with .cmd file for easy, one click .bin + .cue conversion to CHD. Can someone please make me or point me to similar .cmd file for just as easy extracting?

Here are my chdman.exe and .cmd files: https://drive.google.com/open?id=1zG8rJYxMSzKl6dGIOEUocXCOC6ry5fls

2 Likes

I’m not familiar with .cmd files, but if you can implement it yourself the command is:

chdman extractcd -i FILE.chd -o FILE.cue -ob FILE.bin

where FILE is whatever you wish (presumably the game name).

2 Likes

Thanks for the replay! Here is what’s inside .cmd file. Maybe that helps altho pasting it here changes where new lines begin:

@echo off @cls set rompath=C:\Users\Bero\Desktop set destpath=C:\Users\Bero\Desktop for /R “%rompath%” %%G in (*.cue) do ( echo. echo === Converting %%~nG to CHD === chdman createcd -i “%%G” -o “%destpath%%%~nG.chd” -f echo. echo. )

I opened command prompt, went to folder where chdman and .chd file were and entered: “chdman extractcd -i FILE.chd -o FILE.cue -ob FILE.bin” (with game name replacing “FILE”). Nothing happened. What was I doing wrong?

Hard to know without knowing what your .chd files are named and where they are. I would guess a mistake specifying the input chd filename.

chdman.exe should exit with an error, what is it?

Microsoft Windows [Version 6.1.7601] Copyright © 2009 Microsoft Corporation. All rights reserved.

C:\Users\Bero>cd documents

C:\Users\Bero\Documents>cd games

C:\Users\Bero\Documents\Games>cd sega saturn

C:\Users\Bero\Documents\Games\Sega Saturn>chdman extractcd -i Dragon Ball Z - Shin Butoden (Japan).chd -o Dragon Ball Z - Shin Butoden (Japan).cue -ob Dragon Ball Z - Shin Butoden (Japan).bin chdman - MAME Compressed Hunks of Data (CHD) manager 0.189 (mame0189) Error: Expected option, not parameter

Usage: chdman extractcd [options], where valid options are: –output, -o : output file name (required) –outputbin, -ob : output file name for binary data –force, -f: force overwriting an existing file –input, -i : input file name (required) –inputparent, -ip : parent file name for input CHD

C:\Users\Bero\Documents\Games\Sega Saturn>

Try filenames in quotes:

chdman extractcd -i "Dragon Ball Z - Shin Butoden (Japan).chd" -o "Dragon Ball Z - Shin Butoden (Japan).cue" -ob "Dragon Ball Z - Shin Butoden (Japan).bin"

1 Like

Yeah that worked. Thank you very much!

I have a compression script that will make Bin+Cue files a CHD, even multi track bins will work. Now, how do I uncompress them when needed, can you edit this script so we can all have a script that will revert the games back to the uncompressed state?

@echo off 
@cls 
set rompath=
set destpath=
for /R "%rompath%" %%G in (*.cue) do ( 
echo. 
echo === Converting %%~nG to CHD ===
chdman createcd -i "%%G" -o "%destpath%\%%~nG.chd" -f 
echo. 
echo. 
)

place a copy of chdman from official mame release in the same folder as the chds along with a text file with the following inside:

for /r %%i in (*.chd) do chdman extractcd -i “%%i” -o “%%~ni.cue”

rename the text file to extract.bat and run it


To recompress, use this as the command:

for /r %%i in (*.cue, *.gdi) do chdman createcd -i “%%i” -o “%%~ni.chd”


Although only cue is referenced, the .bin/.iso files need to be in the folder too.

1 Like

Thank you, can you elaborate? The batch I posted earlier is nice because I can choose input and output folder, it’s better this way so we don’t stress out our storage making it read and write at the same time.

extract%20CHD%20-%20Copy

Basically put chdman.exe (which you can get from mamedev.org) and create a .bat file with the code I mentioned and run it.

1 Like

@aorin1 Here’s your script modified for exttaction instead of compression. Paste it on a bat file and use it the same way. I’m on my mobile right now, can’t test it but I think its correct and will work

@echo off @cls set rompath= set destpath= for /R “%rompath%” %%G in (*.chd) do ( echo. echo === Extracting %%~nG from CHD === chdman extractcd -i “%%G” -o “%destpath%%%~nG.cue” -f echo. echo. )

1 Like

Is there a way to extract to multi-track bin? I assumed Kronos supported CHD and converted all the bin/cue’s. Now the extracted bin/cue’s can’t be loaded, I used CHD v5 but this might be related to multitrack.