從Windows 10 版本 1809開始, Windows ADK (Windows Assessment and Deployment Kit)的安裝選項不再包含Windows PE (Windows Preinstallation Environment).
要在安裝完Windows ADK後, 另外用Windows PE add-on for the Windows ADK安裝.
安裝Windows ADK:
安裝Windows PE add-on for the Windows ADK:
2018年11月18日
2018年10月7日
P6 如何用 Windows系統映像管理員(Windows System Image Manager) 製作Windows 10自動安裝回應檔案
PART VI 使用DiskPart建立磁碟分割
PART I 準備工作
PART II 瞭解Windows 10安裝過程
PART III 製作自動安裝回應檔案
PART IV 如何使用
PART V 關閉[SMB 1.0/CIFS 檔案共用支援]功能
PART VI 使用DiskPart建立磁碟分割
PART VII 不要預留[保留的儲存空間]
PART VIII 指定電腦名稱與加入網域
PART IX 彈性搭配批次檔使用
PART Max 懶人包
利用DiskPart建立磁碟分割後再安裝Windows會比直接寫在autounattend.xml內來得有彈性. (像是把Recovery tools分割擺在最後面)
以UEFI為例, DiskPart可以透過內含命令的文字檔來建立所需要的磁碟分割.
原理可參考: UEFI/GPT-based hard drive partitions
DiskParts.txt (注意: 會先清掉硬碟原先的分割和資料)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | select disk 0 clean convert gpt create partition efi size=100 format quick fs=fat32 label="System" assign letter="S" create partition msr size=16 create partition primary shrink minimum=500 format quick fs=ntfs label="Windows" assign letter="W" create partition primary format quick fs=ntfs label="Recovery tools" assign letter="R" set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" gpt attributes=0x8000000000000001 list volume exit |
windowsPE階段的內容修改如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | <!-- By Proliantaholic https://proliantaholic.blogspot.com --> <settings pass="windowsPE"> <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SetupUILanguage> <UILanguage>zh-TW</UILanguage> </SetupUILanguage> <InputLocale>zh-TW</InputLocale> <SystemLocale>zh-TW</SystemLocale> <UILanguage>zh-TW</UILanguage> </component> <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <UserData> <ProductKey> <Key>W269N-WFGWX-YVC9B-4J6C9-T83GX</Key> <WillShowUI>OnError</WillShowUI> </ProductKey> <AcceptEula>true</AcceptEula> </UserData> <RunSynchronous> <RunSynchronousCommand wcm:action="add"> <Order>1</Order> <Path>cmd /c DiskPart /s A:\DiskParts.txt</Path> <Description>Create partitions</Description> </RunSynchronousCommand> </RunSynchronous> <DiskConfiguration> <WillShowUI>OnError</WillShowUI> </DiskConfiguration> <ImageInstall> <OSImage> <InstallFrom> <MetaData wcm:action="add"> <Key>/IMAGE/DISPLAYNAME</Key> <Value>Windows 10 Pro</Value> </MetaData> </InstallFrom> <InstallToAvailablePartition>true</InstallToAvailablePartition> <WillShowUI>OnError</WillShowUI> </OSImage> </ImageInstall> </component> </settings> |
安裝過程會看到類似這樣:
2020.05.05 補充: 另一種寫法, 可以判斷是BIOS還是UEFI模式, 呼叫DiskPart分割磁碟.
使用方法請參考: PART Max 懶人包
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | @echo off REM ########################################################### REM # By Proliantaholic https://proliantaholic.blogspot.com # REM ########################################################### for /f "tokens=9 delims= " %%i in ('find /i "Detected boot environment" "%systemdrive%\windows\Panther\setupact.log"') do set FirmwareType=%%i if "%FirmwareType%" == "BIOS" goto BIOS if "%FirmwareType%" == "EFI" goto UEFI Echo Detection error! pause goto end :BIOS ( Echo select disk 0 Echo clean Echo. Echo create partition primary size=50 Echo format quick fs=ntfs Echo assign letter="S" Echo active Echo. Echo create partition primary Echo shrink minimum=550 Echo format quick fs=ntfs Echo assign letter="W" Echo. Echo create partition primary Echo format quick fs=ntfs Echo assign letter="R" Echo set id=27 Echo. Echo list volume Echo exit ) > %TEMP%\BIOSpart.txt DiskPart /s %TEMP%\BIOSpart.txt Echo. Echo Detected Firmware Type: %FirmwareType% Echo Partitions created use: BIOSpart.txt Echo. goto end :UEFI ( Echo select disk 0 Echo clean Echo convert gpt Echo. Echo create partition efi size=100 Echo format quick fs=fat32 Echo assign letter="S" Echo. Echo create partition msr size=16 Echo. Echo create partition primary Echo shrink minimum=550 Echo format quick fs=ntfs Echo assign letter="W" Echo. Echo create partition primary Echo format quick fs=ntfs Echo assign letter="R" Echo set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" Echo gpt attributes=0x8000000000000001 Echo. Echo list volume Echo exit ) > %TEMP%\UEFIpart.txt DiskPart /s %TEMP%\UEFIpart.txt Echo. Echo Detected Firmware Type: %FirmwareType% Echo Partitions created use: UEFIpart.txt Echo. goto end :end |
繼續閱讀:
PART VII 不要預留[保留的儲存空間]
2017年5月16日
P5 如何用 Windows系統映像管理員(Windows System Image Manager) 製作Windows 10自動安裝回應檔案
PART V 關閉[SMB 1.0/CIFS 檔案共用支援]功能
PART I 準備工作
PART II 瞭解Windows 10安裝過程
PART III 製作自動安裝回應檔案
PART IV 如何使用
PART V 關閉[SMB 1.0/CIFS 檔案共用支援]功能
PART VI 使用DiskPart建立磁碟分割
PART VII 不要預留[保留的儲存空間]
PART VIII 指定電腦名稱與加入網域
PART IX 彈性搭配批次檔使用
PART Max 懶人包
最近勒索軟體病毒肆虐, 微軟其實一直都建議大家不要再使用SMB 1.0.
在回應檔案裏面加入PowerShell指令就可以在安裝Windows 10時關閉[SMB 1.0/CIFS 檔案共用支援]功能(預設是開啟的).
- Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol -NoRestart
改好的autounattend.xml應該類似這樣:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | <?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="windowsPE"> <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SetupUILanguage> <UILanguage>zh-TW</UILanguage> </SetupUILanguage> <InputLocale>zh-TW</InputLocale> <SystemLocale>zh-TW</SystemLocale> <UILanguage>zh-TW</UILanguage> </component> <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <UserData> <ProductKey> <Key>W269N-WFGWX-YVC9B-4J6C9-T83GX</Key> <WillShowUI>OnError</WillShowUI> </ProductKey> <AcceptEula>true</AcceptEula> </UserData> <DiskConfiguration> <Disk wcm:action="add"> <CreatePartitions> <CreatePartition wcm:action="add"> <Order>1</Order> <Size>500</Size> <Type>Primary</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Extend>true</Extend> <Order>2</Order> <Type>Primary</Type> </CreatePartition> </CreatePartitions> <ModifyPartitions> <ModifyPartition wcm:action="add"> <Active>true</Active> <Format>NTFS</Format> <Label>系統保留</Label> <Order>1</Order> <PartitionID>1</PartitionID> </ModifyPartition> <ModifyPartition wcm:action="add"> <Format>NTFS</Format> <Letter>C</Letter> <Order>2</Order> <PartitionID>2</PartitionID> </ModifyPartition> </ModifyPartitions> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> </Disk> <WillShowUI>OnError</WillShowUI> </DiskConfiguration> <ImageInstall> <OSImage> <InstallFrom> <MetaData wcm:action="add"> <Key>/IMAGE/DISPLAYNAME</Key> <Value>Windows 10 Pro</Value> </MetaData> </InstallFrom> <InstallTo> <DiskID>0</DiskID> <PartitionID>2</PartitionID> </InstallTo> </OSImage> </ImageInstall> </component> </settings> <settings pass="oobeSystem"> <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <InputLocale>zh-TW</InputLocale> <SystemLocale>zh-TW</SystemLocale> <UILanguage>zh-TW</UILanguage> <UserLocale>zh-TW</UserLocale> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <UserAccounts> <LocalAccounts> <LocalAccount wcm:action="add"> <Password> <Value>cABhAHMAcwB3AG8AcgBkAFAAYQBzAHMAdwBvAHIAZAA=</Value> <PlainText>false</PlainText> </Password> <Description>Administrative User</Description> <DisplayName>admin</DisplayName> <Group>Administrators</Group> <Name>admin</Name> </LocalAccount> </LocalAccounts> </UserAccounts> <OOBE> <ProtectYourPC>3</ProtectYourPC> </OOBE> </component> </settings> <settings pass="specialize"> <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <RunSynchronous> <RunSynchronousCommand wcm:action="add"> <Path>powershell Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol -NoRestart</Path> <Description>Turn off SMB 1.0/CIFS File Sharing Support...</Description> <Order>1</Order> </RunSynchronousCommand> </RunSynchronous> </component> </settings> </unattend> |
安裝過程會看到:
安裝完成後確認:
繼續閱讀:
PART VI 使用DiskPart建立磁碟分割
訂閱:
文章 (Atom)