title: Batch file to find USB drive and change drive letter
body: <p>I'm trying to automate our imaging process. We have multiple computer models with different images all stored on one USB drive with WinPE. I have gotten as far as creating a script that with give me options using <code>Choice</code> to select which computer I want to image but the problem is that depending on what computer I'm imaging the usb drive's letter changes. I'm looking to create a batch file that will find the USB drive and change the drive letter to say "X:" so that the <code>Choice</code> script can run properly with a static drive letter to look for the image files. </p>
  
  <p>I search and found a script that will find the USB drive by name "Ace" and output the drive letter but havent been able to figure out how to take that drive and change it to "X:"</p>
  
  <pre><code>for /f "tokens=3 delims= " %%A in ('echo list volume ^| diskpart ^| findstr "Ace"') do (set Acedrive=%%A)
  </code></pre>
  
  <p>What I have so far is this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>echo off
  cls
  Echo Image Selection Menu
  Echo =======================
  Echo 1 Dell D820
  Echo 2 Dell E6510
  Echo 3 Dell E6520
  Echo 4 Lenovo T431S
  Echo 5 Lenovo T440S
  Echo 6 Lenovo M73 Tiny
  Echo =======================
  Choice /C 123456 /M "What computer are you trying to image?"
  If Errorlevel 6 goto 6
  If Errorlevel 5 goto 5
  If Errorlevel 4 goto 4
  If Errorlevel 3 goto 3
  If Errorlevel 2 goto 2
  If Errorlevel 1 goto 1
  
  Goto End
  
  :6
  cls
  imagex /apply M73.wim 1 g:
  Goto End
  
  :5
  cls
  imagex /apply T440S.wim 1 g:
  Goto End
  
  :4
  cls
  imagex /apply T431S.wim 1 g:
  Goto End
  
  :3
  cls
  imagex /apply E6520.wim 1 g:
  Goto End
  
  :2
  cls
  imagex /apply E6510.wim 1 g:
  Goto End
  
  :1
  cls
  imagex /apply D820.wim 1 g:
  :End</code></pre>
  </div>
  </div>
  </p>
  
  <p>So This basically just gives me options to choose what computer I'm imaging then runs the associated imagex command for that wim.
  Any help would be greatly appreciated! </p>
  
  <p>Thanks</p>