New
#11
You can run DiskPart from a bootable USB device.
Create Bootable USB Flash Drive to Install Windows 10
You can also run DiskPart from a WinPE device.
You can run DiskPart from a bootable USB device.
Create Bootable USB Flash Drive to Install Windows 10
You can also run DiskPart from a WinPE device.
actually you really do not want to Pre-Assign drive letter "C" (thus I used "W") as "C" will automatically be assigned to the OS partition when booted... DiskPart is embedded into PE....
As there is more to it - to set ID & Hide the system and system image partition...
Code:rem === HideRecoveryPartitions-BIOS.txt === select disk 0 select partition 1 set id=17 remove select partition 4 set id=27 remove list volume exitYou can drop install.wim on Deploy.bat - and the full deployment will be automated - CreatePartition - Apply Image - Hide Partitions - Although contains both MBR & UEFI deployment with Boot DetectionCode:@echo == ApplyImage.bat == @echo. @echo These commands deploy a specified Windows @echo image file to the Windows partition, and configure @echo the system partitions. @echo. @echo Usage: ApplyImage WimFileName @echo Example: ApplyImage D:\Install.wim @echo. @echo Applying the image to the Windows partition dism /Apply-Image /ImageFile:%1 /Index:1 /ApplyDir:W:\ @echo. @echo Copying boot files to the System partition == W:\Windows\System32\bcdboot W:\Windows /s S: @echo. @echo Copying the Windows RE image to the @echo Windows RE Tools partition md R:\Recovery\WindowsRE xcopy /h W:\Windows\System32\Recovery\Winre.wim R:\Recovery\WindowsRE\
Code:@cls @echo ********************************************************************** @echo Deploy.bat @echo Note: Run from the reference device in the WinPE environment @echo. @echo. @if %1x==x echo Re-run this program with a path to a WIM file, example: @if %1x==x echo Deploy.bat D:\install.wim @if %1x==x goto END @echo. @echo. @echo Detecting the firmware mode (BIOS or UEFI). @echo Note: Some PCs may support both modes. @echo Verify you're booted into the correct mode before proceeding: wpeutil UpdateBootInfo for /f "tokens=2* delims= " %%A in ('reg query HKLM\System\CurrentControlSet\Control /v PEFirmwareType') DO SET Firmware=%%B @echo Note: delims is a TAB followed by a space. @echo. if %Firmware%==0x1 echo Detected firmware mode: BIOS. if %Firmware%==0x2 echo Detected firmware mode: UEFI. @echo If this is correct, press a key to continue. @echo. @echo If this is NOT correct: Press Ctrl+C to exit this script. @echo Type exit to reboot the PC, and then @echo boot the USB key using the correct firmware mode. @pause @echo ********************************************************************** @echo. @echo Partition and format the disk @echo CAUTION: All the data on the primary disk will be DELETED. pause if %Firmware%==0x1 diskpart /s %~dp0CreatePartitions-BIOS.txt if %Firmware%==0x2 diskpart /s %~dp0CreatePartitions-UEFI.txt pause @echo. @echo. @echo ********************************************************************** @echo. @echo. @echo Applying image call %~dp0ApplyImage %1 pause @echo @echo @echo ********************************************************************** @echo. @echo Hiding the recovery tools partition @echo. @echo. if %Firmware%==0x1 diskpart /s %~dp0HideRecoveryPartitions-BIOS.txt if %Firmware%==0x2 diskpart /s %~dp0HideRecoveryPartitions-UEFI.txt @echo. @echo. @echo ********************************************************************** @echo All done! @echo Disconnect the USB drive from the reference device. @echo. @pause exit :END
Thank you so much everyone for your replies and advice, it is appreciated.
I am going to mark this thread asSolved
. I will spend some time over the next week investigating and getting my head around the code. I will probably initially setup the Disk as normal and then after the installation has completed useMiniTool Partition Wizard
for the other Partitons.
I will dig out an old HDD [ I must have one somewhere ] and try out the above.
Thanks again.