本地硬盘上用,能否删除系统所在的主分区?作者: zengqcyxx 时间: 2016-3-26 02:20
1. DiskPart支持脚本,使用脚本可以自动化 Windows RE 工具分区、系统、MSR、Windows 和恢复映像分区的配置。将以下代码保存为 CreatePartitions.txt
-------------------------------------------------------------------------------------------------------------------
rem == CreatePartitions-UEFI.txt ==
rem == These commands are used with DiskPart to
rem create five partitions
rem for a UEFI/GPT-based PC.
rem Adjust the partition sizes to fill the drive
rem as necessary. ==
select disk 0
clean
convert gpt
rem == 1. Windows RE tools partition ===============
create partition primary size=300
format quick fs=ntfs label="Windows RE tools"
assign letter="T"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
rem == 2. System partition =========================
create partition efi size=100
rem ** NOTE: For Advanced Format 4Kn drives,
rem change this value to size = 260 **
format quick fs=fat32 label="System"
assign letter="S"
rem == 3. Microsoft Reserved (MSR) partition =======
create partition msr size=128
rem == 4. Windows partition ========================
rem == a. Create the Windows partition ==========
create partition primary
rem == b. Create space for the recovery image ===
shrink minimum=15000
rem ** NOTE: Update this size to match the size
rem of the recovery image **
rem == c. Prepare the Windows partition =========
format quick fs=ntfs label="Windows"
assign letter="W"
rem === 5. Recovery image partition ================
create partition primary
format quick fs=ntfs label="Recovery image"
assign letter="R"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
list volume
exit
------------------------------------------------------------------------
2.使用 Windows PE 启动目标电脑。
3.使用 DiskPart /s F:\CreatePartitions.txt 命令,其中 F 是 U 盘的驱动器号,用于对驱动器进行分区。