And that could be a useful batch for the same (it can run from WinPE which does not have Powershell): Code: @Echo off setlocal enabledelayedexpansion Set "USB=" REM get removable loaded drives: for /f "tokens=1-5" %%a in ( 'wmic logicaldisk list brief' ) do if %%b Equ 2 if %%d gtr 0 Set USB=!USB! %%a Echo:Usb removable drives:%USB% EndLocal&Set USB=%USB:~1%&Goto :Eof
Hi All, Greets, 1. Sir, Thanks. To add : USB7ice is a great tool for creating a pen drive with any windows distributions where the biggest file or Install.wim is equal or less than 4 GB. It creates a media which is compatible with UEFI + GPT , UEFI CSM & Legacy bios ( MBR ). For eg. If a BIOS is configured for both ''UEFI + Legacy BIOS'', It will show two boot entries : One as UEFI & other as traditional Legacy USB entry. ( It reminds me of writing an ISO on a DVD. That uses FAT32 & is bootable on both UEFI & Legacy BIOS ) 2. Sir, The 1903 version's Install.wim was just under 4gb. 3. What USB7ice actually does while using Standard BCD ( Vista & Vista + Distributions ) with FAT32 ( Default ): It simply formats a pen drive in FAT32 with single partition & simply extracts a windows distribution ISO to the root of USB Pen drive. That's it. It can be done manually as well. ( The trick was once shared by Sir Enthousiast ) Thanks & Regards. ...
There's also Windows installation disk This script automates creating a customized Windows installation disk. For both Legacy BIOS and the native UEFI boot process. For systems that use UEFI with Secure Boot Even for Windows ISOs that have Install.WIMs that are over 4GB (Due to the 4GB limitation of FAT32).
Code: Function Get-USBObject { [CmdletBinding()] [OutputType([PSCustomObject])] Param ( [Parameter(Mandatory = $true, Position = 0)] [ValidateLength(1, 3)] [string]$DriveLetter ) $DriveLetter = $DriveLetter.Substring(0, 1).ToUpper() Get-CimInstance -ClassName Win32_DiskDrive | Where-Object { $_.InterfaceType -eq 'USB' -and $_.MediaType -eq 'Removable Media' } | Sort-Object -Property DeviceID | ForEach-Object -Process { If ((Get-Partition -DiskNumber $_.Index).DriveLetter -eq $DriveLetter) { Get-Disk -Number $_.Index } } } So you can do $USB = (Get-USBObject -DriveLetter H) and it will add the disk object to the $USB variable.
Sir, Greets, It was linked by Kyhi sir only. It has checksums provided by him only : SHA256 = 5E0EA09B00FCC15E40B6F11FFDC5014C40128CA89A3991F518DB92F40616543B If still required, I will delete the link. Let me know. Thanks & Regards. ...
Shouldn't it be Code: ramdisk=[G:]\sources\boot.wim,%ramdisk% instead of Code: ramdisk=[G:]\sources\boot_x64.wim,%ramdisk%
You are right, i posted the wrong script (for WinPE instead of Windows). Spoiler Code: Echo Creating BCD entrys for Windows 64 UEFI set BCDEDIT=%SYSTEMROOT%\system32\bcdedit.exe Echo Creating ramdisksdidevice entry... for /f "tokens=2 delims={}" %%g in ('%BCDEDIT% /create /device') do set ramdisk={%%g} %BCDEDIT% /set %ramdisk% ramdisksdidevice partition=G: %BCDEDIT% /set %ramdisk% ramdisksdipath \boot\boot.sdi Echo Adding RAM Boot WinFE entry... for /f "tokens=2 delims={}" %%g in ('%BCDEDIT% /create /application osloader') do set GUID={%%g} %BCDEDIT% /set %GUID% device ramdisk=[G:]\sources\boot.wim,%ramdisk% %BCDEDIT% /set %GUID% path \Windows\System32\Boot\winload.efi %BCDEDIT% /set %GUID% description "Install Windows 64 UEFI" %BCDEDIT% /set %GUID% osdevice ramdisk=[G:]\sources\boot.wim,%ramdisk% %BCDEDIT% /set %GUID% systemroot \Windows %BCDEDIT% /set %GUID% detecthal Yes %BCDEDIT% /set %GUID% winpe Yes %BCDEDIT% /displayorder %guid% /addlast pause exit/b