If not ' %XBO_SIZE%' ='' set choice = %choice:~ 0, 1%Įcho " %XBO_SIZE% " is not valid please try againĬALL : Calc %XBO_DISK_SECTORS%* %DEV_LOGICAL_BLOCK_SIZE_IN_BYTES%
::echo create partition primary size=%XBOX_TEMP_SIZE_IN_MBYTES% offset=1024 > %XBO_DP_SCRIPT% Set /a XBOX_TEMP_SIZE_IN_MBYTES =%XBO_CALC_RESULT% :: Calculate partition sizes, creation moved to gdisk belowĬALL : Calc %XBOX_TEMP_SIZE_IN_BYTES%/1024/1024Įcho * Temp Content: MByte Size: ' %XBO_CALC_RESULT%' * > %XBO_LOG% 2 >&1 :: End of diskpart remove existing partitions (works but clunky since partitions have to be removed individually) ::for /f "tokens=*" %%A in ('%XBO_GDISK% \\.\physicaldrive%XBO_FORMAT_DRIVE% ^> %XBO_DP_SCRIPT% ::echo delete partition override > !XBO_DP_SCRIPT! ::echo select partition %%A > !XBO_DP_SCRIPT! :: When the first partition is removed all other partitions cascade down ::for /f "tokens=2" %%A in ('%XBO_DISKPART% /s %XBO_DP_SCRIPT% ^| findstr /b /r /c:" *Partition " ^| sort /r') do ( :: Determine the number of partitions to delete ::echo select disk %XBO_FORMAT_DRIVE% > %XBO_DP_SCRIPT% :: Replaced with gdisk (remove existing partitions) :: Start of diskpart remove existing partitions (works but clunky since partitions have to be removed individually) Set XBO_MESSAGE =* Disk %XBO_FORMAT_DRIVE% will be formatted as an Xbox One. *Ĭhoice.exe /C 0 %XBO_CHOICE% /D 0 /T %XBO_TIMEOUT% /M "Press 0 to CANCEL or use a Disk Number from the list above (default 0 in %XBO_TIMEOUT% seconds) "Įcho Selected drive: %XBO_FORMAT_DRIVE% > %XBO_LOG% 2 >&1Įcho Sectors: %XBO_DISK_SECTORS% > %XBO_LOG% 2 >&1Įcho Logical block size: %DEV_LOGICAL_BLOCK_SIZE_IN_BYTES% > %XBO_LOG% 2 >&1Ĭhoice.exe /M "WARNING: This will erase all data on this disk. ::echo * Testing: Choice list: %XBO_CHOICE% *Įcho * Select disk to format as an Xbox One Drive. If %XBO_CNT% EQU %XBO_DRIVE_COUNT% goto rchoice ::echo * Testing: Valid drive list: '%XBO_CNT%' * ::echo * Testing: Valid drive count: '%XBO_DRIVE_COUNT%' * ::%XBO_DISKPART% /s %XBO_DP_SCRIPT% | findstr /b /r /c:" *Disk " | find /c "Disk"įor /f "tokens=* " %%A in (' %XBO_DISKPART% /s %XBO_DP_SCRIPT% ^| findstr /b /r /c: " *Disk " ^| find /c "Disk "') do (set XBO_DRIVE_COUNT= %%A) :: Ignore the header (Disk #) and Disk 0 lines %XBO_DISKPART% /s %XBO_DP_SCRIPT% > %XBO_LOG% 2 >&1 :: List will not include USB flash drives (according to Microsoft) Set XBOX_UPDATE_SIZE2_IN_BYTES = 7516192768Įcho * Scanning for connected USB/SATA drives. :: Common partition sizes used by XBox One Set XBO_MOUNTVOL = %SystemRoot%\system32\mountvol Set XBO_FORMAT = %SystemRoot%\system32\format Set XBO_DISKPART = %SystemRoot%\system32\diskpart :: Check for the presence of a drive other than C: :: A super-duper simple command line calculator that is fast and easy to use: Numbers are limited to 32-bits of precision.
#XBOX HDD MASTER 64 BIT#
:: GPT fdisk is a disk partitioning tool loosely modeled on Linux fdisk, but used for modifying GUID Partition Table (GPT) disks:įor /f "tokens=3 " %%A in ('reg query "HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0 " /v Identifier ^| findstr /b /r /c: " *Identifier "') do (set WINBIT= %%A)Įcho "This is a 32 Bit Operating System "Įcho "This is a 64 Bit Operating System "
#XBOX HDD MASTER HOW TO#
:: How To Check If Computer Is Running A 32 Bit or 64 Bit Operating System. :: I've used higher letters to avoid conflicts