title: Bat script which creates ISO from a CD/DVD drive
body: <p>Stack community good day! Thank you in advance for your time</p>
  <p>I would like to create a bat file in order to autocreate an iso file from the DVD drive. So the logic will be:</p>
  <ol>
  <li><p>Find which is the CD/DVD drive (from many drives)</p>
  </li>
  <li><p>And use that result as a variable (of the drive: for example F:) which will be executed in the following command:</p>
  <p>cdbxpcmd.exe --burn-data -folder:F:\ -iso:C:\donalds.iso -format:iso</p>
  </li>
  </ol>
  <p>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.</p>
  <p>I have found the following script that finds the drive letter,
  from here: <a href="https://itectec.com/superuser/windows-how-to-detect-dvd-drive-letter-via-batch-file-in-ms-windows-7/" rel="nofollow noreferrer">https://itectec.com/superuser/windows-how-to-detect-dvd-drive-letter-via-batch-file-in-ms-windows-7/</a></p>
  <pre><code>@echo off
  setlocal
  for /f &quot;skip=1 tokens=1,2&quot; %%i in ('wmic logicaldisk get caption^, drivetype') do (
    if [%%j]==[5] echo %%i
    )
  endlocal
  </code></pre>
  <p>Do you believe that we could combine them? And how? Any suggestions?</p>