I am in the process of writing a bespoke DOS batch file (in WinPE) to run a windows imaging system. I require that the drive letters to all the partitions and the WinPE USB be set to specific ones, however when I change them using a DISKPART text file I get an unable to find path error.
Code: Select all
FOR %%i IN (C D E F G H I J K) DO IF EXIST %%i:\test.txt SET Drive=%%i: - Finds what drive the USB is in
ECHO SEL DISK 1 >> %Drive%\DP1.TXT
ECHO SEL PART 1 >> %Drive%\DP1.TXT
ECHO ASSIGN LETTER=W: >> %Drive%\DP1.TXT
DISKPART /S %Drive%\DP1.TXT
SET %Drive%=W:
DEL %Drive%\DP1.TXT
ECHO SEL DISK 0 > %Drive%\DP1.TXT
ECHO SEL PART 1 >> %Drive%\DP1.TXT
ECHO ASSIGN LETTER=V: >> %Drive%\DP1.TXT
ECHO REMOVE LETTER=V: >> %Drive%\DP1.TXT
ECHO SEL PART 2 >> %Drive%\DP1.TXT
ECHO ASSIGN LETTER=C: >> %Drive%\DP1.TXT
ECHO SEL PART 3 >> %Drive%\DP1.TXT
ECHO ASSIGN LETTER=Y: >> %Drive%\DP1.TXT
ECHO REMOVE LETTER=Y: >> %Drive%\DP1.TXT
DISKPART /S %Drive%\DP1.TXT
Everything runs fine up to the highlighted command, this is where I get the error, even though the DISKPART has been run and the USB drive letter has been changed.
With thanks
Fug