title: Automate partitioning a disk using DISKPART and prompting user for disk or quit
body: <p>I need to create a batch file which partitions and formats a USB drive.  This is to create a Windows 7 USB boot disk.</p>
  
  <p>DISKPART is the tool used and you pass it instructions as in:</p>
  
  <p>DISKPART /s instructions.txt</p>
  
  <p>In my case I want my instructions to look like this:</p>
  
  <pre><code>example prepdisk.txt
  SELECT DISK &lt;Prompt user to either enter a number or q for quit&gt;
  CLEAN
  CREATE PARTITION PRIMARY
  FORMAT QUICK FS=NTFS LABEL="Windows"
  ACTIVE
  ASSIGN LETTER="C"
  </code></pre>
  
  <p>Then I would have a batch file like this:</p>
  
  <p>prepdisk.bat:</p>
  
  <pre><code>DISKPART /s prepdisk.txt
  </code></pre>
  
  <p>But I am stuck on how to prompt the user for a disk id.  I also want to be able to quit if unsure because obviously formatting the wrong drive could be dangerous.</p>