Home > database >  Bat script which creates ISO from a CD/DVD drive
Bat script which creates ISO from a CD/DVD drive

Time:09-28

Stack community good day! Thank you in advance for your time

I would like to create a bat file in order to autocreate an iso file from the DVD drive. So the logic will be:

  1. Find which is the CD/DVD drive (from many drives)

  2. And use that result as a variable (of the drive: for example F:) which will be executed in the following command:

    cdbxpcmd.exe --burn-data -folder:F:\ -iso:C:\donalds.iso -format:iso

So in the previous command, the F:\ will be the variable, lets say %input%:\ which the program cdbxpcmd will use in order to create an iso from that drive.

I have found the following script that finds the drive letter, from here: https://itectec.com/superuser/windows-how-to-detect-dvd-drive-letter-via-batch-file-in-ms-windows-7/

@echo off
setlocal
for /f "skip=1 tokens=1,2" %%i in ('wmic logicaldisk get caption^, drivetype') do (
  if [%%j]==[5] echo %%i
  )
endlocal

Do you believe that we could combine them? And how? Any suggestions?

CodePudding user response:

You could use cdbxpcmd.exe itself to locate your drive:

Two line example:

@Set "CDBXP=C:\Program Files\CDBurnerXP\cdbxpcmd.exe"
@For /F "Tokens=2 Delims=()" %%G In ('^""           
  • Related