Good Afternoon,

Does anyone know if the USB drive is always the "D" drive when one boots off of USB?  That is if a PC has multiple Disks/CD Roms.

We have a one piece of software that is a rather large install (20 gig) and would like to create a basic script on the image but point to and install from the USB drive itself.  Once this is done, we would copy the files to the deployment drive to a folder under the root.

If not, is there a way to batch script to find the correct letter of the drive?

Any help appreciated.

Thank You
0 Comments   [ + ] Show Comments


Please log in to comment


it will change depending on the drives already in the system
Answered 06/06/2016 by: SMal.tmcc
Red Belt

Please log in to comment

maybe with fsutil

>>>>>>>>rash thoughts:

get driveletter:

for /F "tokens=1*" %%a in ('fsutil fsinfo drives') do (
   for %%c in (%%b) do (
        for /F "tokens=3" %%d in ('fsutil fsinfo drivetype %%c') do (
              if "%%d" equ "Removable" (echo Drive %%c is Removable && set usbdrive=%%c)
rem german  if "%%d" equ "Austauschbares" (echo Drive %%c is Removable && set usbdrive=%%c)

make diskpartscript:

set disparttxt=%usbdrive%diskpart.txt

echo select volume %usbdrive% >%disparttxt%
echo assign letter=q >>%disparttxt%
echo select volume 0 >>%disparttxt%
echo select disk 0 >>%disparttxt%
echo clean >>%disparttxt%
echo create partition primary size=150000 >>%disparttxt%
echo assign letter="C" >>%disparttxt%
echo active >>%disparttxt%
echo create partition Primary >>%disparttxt%
echo assign letter="D" >>%disparttxt%
echo Exit >>%disparttxt%

start diskpart:

diskpart /s %disparttxt%

Answered 06/08/2016 by: jfmav
White Belt

Please log in to comment
Answer this question or Comment on this question for clarity