Qua theo dõi 4 phần vừa qua thì bạn đã có được kiến thức cớ bản về tạo và cấu hình file trả lời tự động unattend.xml. Trong phần này tôi sẽ chia sẻ một số component và thủ thuật khác mà bạn có thể sử dụng.
File trả lời tự động unattend.xml tổng hợp
Đây là những file mà tôi đã triển khai thực tế ở những bộ cài mà tôi chia sẻ trên website này. Tôi chia là 2 file autounattend.xml và unattend.xml với cấu trúc như sau:
File autounattend.xml chỉ có duy nhất 1 pass windowsPE và chỉ thực thi trong giai đoạn pass 1. Ngoài ra bạn cũng có thể thêm các pass khác vào đây nhưng bắt buộc tên file phải là autounattend.xml và đặt ở vị trí ngang hàng với file setup.exe trong thư mục gốc của bộ cài.
File unatend.xml sẽ bao gồm tất cả các pass còn lại và file này sẽ nằm ở vị trí C:\Windows\System32\Sysprep
Windows 7
autounattend.xml
<?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="x86" 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>en-US</UILanguage> </SetupUILanguage> <InputLocale>1033:00000409</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> <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>en-US</UILanguage> </SetupUILanguage> <InputLocale>1033:00000409</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> <component name="Microsoft-Windows-Setup" processorArchitecture="x86" 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> <AcceptEula>true</AcceptEula> </UserData> <EnableFirewall>true</EnableFirewall> </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> <AcceptEula>true</AcceptEula> </UserData> <EnableFirewall>true</EnableFirewall> </component> </settings> </unattend>
unattend.xml
<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="generalize"> <component name="Microsoft-Windows-Security-SPP" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SkipRearm>1</SkipRearm> </component> </settings> <settings pass="generalize"> <component name="Microsoft-Windows-Security-SPP" 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"> <SkipRearm>1</SkipRearm> </component> </settings> <settings pass="specialize"> <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SkipAutoActivation>true</SkipAutoActivation> </component> <component name="Microsoft-Windows-Security-SPP-UX" 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"> <SkipAutoActivation>true</SkipAutoActivation> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <copyprofile>true</copyprofile> <TimeZone>SE Asia Standard Time</TimeZone> </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"> <copyprofile>true</copyprofile> <TimeZone>SE Asia Standard Time</TimeZone> </component> <component name="Microsoft-Windows-SystemRestore-Main" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <DisableSR>1</DisableSR> </component> <component name="Microsoft-Windows-SystemRestore-Main" 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"> <DisableSR>1</DisableSR> </component> <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" 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"> <Description>Add Computer Desktop Icon 1</Description> <Order>1</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu /v {871C5380-42A0-1069-A2EA-08002B30309D}.default /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Add Computer Desktop Icon 2</Description> <Order>2</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>3</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v Manufacturer /t REG_SZ /d MANHPC /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>4</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportURL /t REG_SZ /d https://manhpc.com /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>5</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportHours /t REG_SZ /d "8h00 - 22h00" /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>6</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportPhone /t REG_SZ /d "+84 91 664 8537" /f</Path> </RunSynchronousCommand> </RunSynchronous> </component> <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"> <Description>Add Computer Desktop Icon 1</Description> <Order>1</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu /v {871C5380-42A0-1069-A2EA-08002B30309D}.default /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Add Computer Desktop Icon 2</Description> <Order>2</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>3</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v Manufacturer /t REG_SZ /d MANHPC /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>4</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportURL /t REG_SZ /d https://manhpc.com /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>5</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportHours /t REG_SZ /d "8h00 - 22h00" /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>6</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportPhone /t REG_SZ /d "+84 91 664 8537" /f</Path> </RunSynchronousCommand> </RunSynchronous> </component> </component> </settings> <settings pass="oobeSystem"> <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" 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>1033:00000409</InputLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> <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>1033:00000409</InputLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <OOBE> <HideEULAPage>true</HideEULAPage> <NetworkLocation>Work</NetworkLocation> <ProtectYourPC>3</ProtectYourPC> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> </OOBE> <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Description>Control Panel View</Description> <Order>1</Order> <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 1 /f</CommandLine> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>2</Order> <Description>Control Panel Icon Size</Description> <RequiresUserInput>false</RequiresUserInput> <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 0 /f</CommandLine> </SynchronousCommand> </FirstLogonCommands> <TaskbarLinks> <Link0>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk</Link0> <Link1>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk</Link1> <Link2></Link2> </TaskbarLinks> <TimeZone>S.E. Asia Standard Time</TimeZone> </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"> <OOBE> <HideEULAPage>true</HideEULAPage> <NetworkLocation>Work</NetworkLocation> <ProtectYourPC>3</ProtectYourPC> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> </OOBE> <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Description>Control Panel View</Description> <Order>1</Order> <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 1 /f</CommandLine> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>2</Order> <Description>Control Panel Icon Size</Description> <RequiresUserInput>false</RequiresUserInput> <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 0 /f</CommandLine> </SynchronousCommand> </FirstLogonCommands> <TaskbarLinks> <Link0>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk</Link0> <Link1>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk</Link1> <Link2></Link2> </TaskbarLinks> <TimeZone>S.E. Asia Standard Time</TimeZone> </component> </settings> </unattend>
Windows 10
autounattend.xml
<?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"> <InputLocale>1033:00000409</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" 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>1033:00000409</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </component> <component name="Microsoft-Windows-Setup" processorArchitecture="x86" 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> <AcceptEula>true</AcceptEula> </UserData> </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> <AcceptEula>true</AcceptEula> </UserData> </component> </settings> </unattend>
unattend.xml (dùng chung cho cả Windows 11)
<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="generalize"> <component name="Microsoft-Windows-Security-SPP" 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"> <SkipRearm>1</SkipRearm> </component> <component name="Microsoft-Windows-Security-SPP" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SkipRearm>1</SkipRearm> </component> <component name="Microsoft-Windows-WorkstationService" 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"> <AllowInsecureGuestAuth>1</AllowInsecureGuestAuth> </component> <component name="Microsoft-Windows-WorkstationService" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <AllowInsecureGuestAuth>1</AllowInsecureGuestAuth> </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"> <Description>Allow Insecure Guest Auth</Description> <Order>1</Order> <Path>cmd /c reg add HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters /v AllowInsecureGuestAuth /t REG_DWORD /d 1 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Disable Reserves</Description> <Order>2</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager /v ShippedWithReserves /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Disable Acrylic Background On Logon</Description> <Order>3</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\System /v DisableAcrylicBackgroundOnLogon /t REG_DWORD /d 1 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Copy To folder</Description> <Order>4</Order> <Path>cmd /c reg add HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\{C2FBB630-2971-11D1-A18C-00C04FD75D13} /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Move To folder</Description> <Order>5</Order> <Path>cmd /c reg add HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\{C2FBB631-2971-11D1-A18C-00C04FD75D13} /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Add This PC Desktop Icon 1</Description> <Order>6</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu /v {871C5380-42A0-1069-A2EA-08002B30309D}.default /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Add This PC Desktop Icon 2</Description> <Order>7</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>8</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v Manufacturer /t REG_SZ /d AKIO /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>9</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportURL /t REG_SZ /d https://manhpc.com /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>10</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportHours /t REG_SZ /d 24/7 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>11</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportPhone /t REG_SZ /d "+84 91 664 8537" /f</Path> </RunSynchronousCommand> </RunSynchronous> </component> <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" 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"> <Description>Allow Insecure Guest Auth</Description> <Order>1</Order> <Path>cmd /c reg add HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters /v AllowInsecureGuestAuth /t REG_DWORD /d 1 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Disable Reserves</Description> <Order>2</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager /v ShippedWithReserves /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Disable Acrylic Background On Logon</Description> <Order>3</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\System /v DisableAcrylicBackgroundOnLogon /t REG_DWORD /d 1 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Copy To folder</Description> <Order>4</Order> <Path>cmd /c reg add HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\{C2FBB630-2971-11D1-A18C-00C04FD75D13} /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Move To folder</Description> <Order>5</Order> <Path>cmd /c reg add HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\{C2FBB631-2971-11D1-A18C-00C04FD75D13} /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Add This PC Desktop Icon 1</Description> <Order>6</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu /v {871C5380-42A0-1069-A2EA-08002B30309D}.default /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Add This PC Desktop Icon 2</Description> <Order>7</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 0 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>8</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v Manufacturer /t REG_SZ /d AKIO /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>9</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportURL /t REG_SZ /d https://manhpc.com /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>10</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportHours /t REG_SZ /d 24/7 /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Description>Support URL</Description> <Order>11</Order> <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportPhone /t REG_SZ /d "+84 91 664 8537" /f</Path> </RunSynchronousCommand> </RunSynchronous> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <copyprofile>true</copyprofile> </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"> <copyprofile>true</copyprofile> </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>1033:00000409</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UILanguageFallback>en-US</UILanguageFallback> <UserLocale>en-US</UserLocale> </component> <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" 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>1033:00000409</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UILanguageFallback>en-US</UILanguageFallback> <UserLocale>en-US</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"> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <Description>Open File Explorer to This PC</Description> <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v LaunchTo /t REG_DWORD /d 1 /f</CommandLine> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>2</Order> <Description>Control Panel 1</Description> <CommandLine>reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 0 /f</CommandLine> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>3</Order> <Description>Control Panel 2</Description> <CommandLine>reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 1 /f</CommandLine> </SynchronousCommand> </FirstLogonCommands> <OOBE> <HideEULAPage>true</HideEULAPage> <ProtectYourPC>1</ProtectYourPC> </OOBE> <TaskbarLinks> <Link0>%programdata%\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk</Link0> <Link1>%programdata%\Microsoft\Windows\Start Menu\Programs\Word.lnk</Link1> <Link2>%programdata%\Microsoft\Windows\Start Menu\Programs\Excel.lnk</Link2> <Link3></Link3> </TaskbarLinks> <RegisteredOrganization>MANHPC</RegisteredOrganization> <TimeZone>SE Asia Standard Time</TimeZone> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <Description>Open File Explorer to This PC</Description> <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v LaunchTo /t REG_DWORD /d 1 /f</CommandLine> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>2</Order> <Description>Control Panel 1</Description> <CommandLine>reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 0 /f</CommandLine> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>3</Order> <Description>Control Panel 2</Description> <CommandLine>reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 1 /f</CommandLine> </SynchronousCommand> </FirstLogonCommands> <OOBE> <HideEULAPage>true</HideEULAPage> <ProtectYourPC>1</ProtectYourPC> </OOBE> <TaskbarLinks> <Link0>%programdata%\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk</Link0> <Link1>%programdata%\Microsoft\Windows\Start Menu\Programs\Word.lnk</Link1> <Link2>%programdata%\Microsoft\Windows\Start Menu\Programs\Excel.lnk</Link2> <Link3></Link3> </TaskbarLinks> <TimeZone>SE Asia Standard Time</TimeZone> </component> </settings> </unattend>
Windows 11
autounattend.xml
<?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"> <InputLocale>1033:00000409</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>en-US</UserLocale> </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> <AcceptEula>true</AcceptEula> </UserData> <RunSynchronous> <RunSynchronousCommand wcm:action="add"> <Order>1</Order> <Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /d 1 /t reg_dword /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Order>2</Order> <Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /d 1 /t reg_dword /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Order>3</Order> <Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassRAMCheck /d 1 /t reg_dword /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Order>4</Order> <Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassStorageCheck /d 1 /t reg_dword /f</Path> </RunSynchronousCommand> <RunSynchronousCommand wcm:action="add"> <Order>5</Order> <Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassCPUCheck /d 1 /t reg_dword /f</Path> </RunSynchronousCommand> </RunSynchronous> </component> </settings> </unattend>
Một số component tham khảo
Thêm driver vào bộ cài (không tích hợp vào file install)
- Tạo folder $WinPEDriver$ ngang hàng với folder sources.
- Thêm vào file AutoUnattend.xml bên dưới <settings pass=”windowsPE”>
<component name="Microsoft-Windows-PnpCustomizationsWinPE" 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"> <DriverPaths> <PathAndCredentials wcm:action="add" wcm:keyValue="1"> <Path>$WinPEDriver$</Path> </PathAndCredentials> </DriverPaths> </component> <component name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <DriverPaths> <PathAndCredentials wcm:action="add" wcm:keyValue="1"> <Path>$WinPEDriver$</Path> </PathAndCredentials> </DriverPaths> </component>
OEMInformation
Việc thêm thông tin OEM vào hệ điều hành ngoài cách chạy lệnh add vào registry thì chúng ta còn có cách sử dụng lệnh <OEMInformation>
<settings pass="specialize"> <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"> <OEMInformation> <Logo>%windir%\Windows\System32\oemlogo.bmp</Logo> <Manufacturer>AKIO</Manufacturer> <SupportHours>08:30 - 16:30</SupportHours> <SupportPhone>+84 91 664 8537</SupportPhone> <SupportURL>https://manhpc.com</SupportURL> </OEMInformation> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <OEMInformation> <Logo>%windir%\Windows\System32\oemlogo.bmp</Logo> <Manufacturer>AKIO</Manufacturer> <SupportHours>08:30 - 16:30</SupportHours> <SupportPhone>+84 91 664 8537</SupportPhone> <SupportURL>https://manhpc.com</SupportURL> </OEMInformation> </component> </settings>
hoặc:
<settings pass="oobe"> <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"> <OEMInformation> <Logo>%windir%\Windows\System32\oemlogo.bmp</Logo> <Manufacturer>AKIO</Manufacturer> <SupportHours>08:30 - 16:30</SupportHours> <SupportPhone>+84 91 664 8537</SupportPhone> <SupportURL>https://manhpc.com</SupportURL> </OEMInformation> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <OEMInformation> <Logo>%windir%\Windows\System32\oemlogo.bmp</Logo> <Manufacturer>AKIO</Manufacturer> <SupportHours>08:30 - 16:30</SupportHours> <SupportPhone>+84 91 664 8537</SupportPhone> <SupportURL>https://manhpc.com</SupportURL> </OEMInformation> </component> </settings>
<DiskConfiguration>
Lệnh này chỉ dùng khi bạn triển khai hàng loạt cho nhiều máy tính mới. Không sử dụng khi cài lại windows mà trên đĩa cứng đang có dữ liệu.
<Themes>
<settings pass="oobeSystem"> <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"> <Themes> <DesktopBackground>%windir%\system32\OEM\manhpc.bmp</DesktopBackground> <ThemeName>MANHPC Theme</ThemeName> </Themes> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Themes> <DesktopBackground>%windir%\system32\OEM\manhpc.bmp</DesktopBackground> <ThemeName>MANHPC Theme</ThemeName> </Themes> </component> </settings>
Enable tài khoản Administrator built-in
<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"> <Description>EnableAdmin</Description> <Order>1</Order> <Path>cmd /c net user Administrator /active:yes</Path> </RunSynchronousCommand> </RunSynchronous> </component> <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" 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"> <Description>EnableAdmin</Description> <Order>1</Order> <Path>cmd /c net user Administrator /active:yes</Path> </RunSynchronousCommand> </RunSynchronous> </component> </settings>
Tự động đăng nhập vào tài khoản Administrator
Để tự động đăng nhập vào tài khoản Administrator cao nhất của hệ thống khi cài đặt Windows thì bạn cần phải enable nó lên trong settings pass=”specialize”. Tiếp theo bạn thêm đoạn bên dưới vào settings pass=”oobeSystem”.
<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"> <OOBE> <HideEULAPage>true</HideEULAPage> <ProtectYourPC>3</ProtectYourPC> <HideLocalAccountScreen>true</HideLocalAccountScreen> <HideOnlineAccountScreens>true</HideOnlineAccountScreens> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> <SkipUserOOBE>true</SkipUserOOBE> <SkipMachineOOBE>true</SkipMachineOOBE> </OOBE> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <OOBE> <HideEULAPage>true</HideEULAPage> <ProtectYourPC>3</ProtectYourPC> <HideLocalAccountScreen>true</HideLocalAccountScreen> <HideOnlineAccountScreens>true</HideOnlineAccountScreens> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> <SkipUserOOBE>true</SkipUserOOBE> <SkipMachineOOBE>true</SkipMachineOOBE> </OOBE> </component>
SYSTEM VARIABLES
SYSTEM: %systemdrive% > C: %homedrive% > C: %windir% > C:\Windows %systemroot% > C:\Windows %programfiles% > C:\Program Files %programfiles(x86)% > C:\Program Files (x86) %commonprogramfiles% > C:\Program Files\Common Files %commonprogramfiles(x86)% > C:\Program Files (x86)\Common Files %programdata% > C:\ProgramData %allusersprofile% > C:\ProgramData USER: %userprofile% > C:\Users\manhnd %homepath% > \Users\manhnd %appdata% > C:\Users\manhnd\AppData\Roaming %localappdata% > C:\Users\manhnd\AppData\Local %public% > C:\Users\Public
Một số lệnh tạo Partitions
CreatePartitions-BIOS:
rem == CreatePartitions-BIOS.txt == rem == These commands are used with DiskPart to rem create three partitions rem for a BIOS/MBR-based computer. rem Adjust the partition sizes to fill the drive rem as necessary. == select disk 0 clean rem == 1. System partition ====================== create partition primary size=100 format quick fs=ntfs label="System" assign letter="S" active rem == 2. Windows partition ===================== rem == a. Create the Windows partition ======= create partition primary rem == b. Create space for the recovery tools shrink minimum=500 rem ** NOTE: Update this size to match the rem size of the recovery tools rem (winre.wim) ** rem == c. Prepare the Windows partition ====== format quick fs=ntfs label="Windows" assign letter="W" rem == 3. Recovery partition ==================== create partition primary format quick fs=ntfs label="Recovery image" assign letter="R" set id=27 list volume exit
CreatePartitions-BIOS-FFU:
rem == CreatePartitions-BIOS-FFU.txt == rem == These commands are used with DiskPart to rem create three partitions rem for a BIOS/MBR-based computer. rem Adjust the partition sizes to fill the drive rem as necessary. == select disk 0 clean rem == 1. System partition ====================== create partition primary size=100 format quick fs=ntfs label="System" assign letter="S" active rem == 2. Windows partition ===================== rem == a. Create the Windows partition ======= create partition primary rem == c. Prepare the Windows partition ====== format quick fs=ntfs label="Windows" assign letter="W" list volume exit
CreatePartitions-UEFI:
rem == CreatePartitions-UEFI.txt == rem == These commands are used with DiskPart to rem create four 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. 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 == 2. Microsoft Reserved (MSR) partition ======= create partition msr size=16 rem == 3. Windows partition ======================== rem == a. Create the Windows partition ========== create partition primary rem == b. Create space for the recovery tools === shrink minimum=500 rem ** NOTE: Update this size to match the rem size of the recovery tools rem (winre.wim) ** rem == c. Prepare the Windows partition ========= format quick fs=ntfs label="Windows" assign letter="W" rem === 4. Recovery partition ====================== create partition primary format quick fs=ntfs label="Recovery" assign letter="R" set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" gpt attributes=0x8000000000000001 list volume exit
CreatePartitions-UEFI-FFU:
rem == CreatePartitions-UEFI-FFU.txt == rem == These commands are used with DiskPart to rem create four 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. 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 == 2. Microsoft Reserved (MSR) partition ======= create partition msr size=16 rem == 3. Windows partition ======================== rem == a. Create the Windows partition ========== create partition primary rem == c. Prepare the Windows partition ========= format quick fs=ntfs label="Windows" assign letter="W" list volume exit
CreateRecoveryPartitions-BIOS:
rem == CreateRecoveryPartitions-BIOS.txt == select disk 0 select partition 2 assign letter="W" rem == extend the Windows partition == shrink minimum=500 extend rem == b. Create space for the recovery tools shrink minimum=500 rem ** NOTE: Update this size to match the rem size of the recovery tools rem (winre.wim) ** rem == c. Prepare the Recovery partition ====== select disk 0 create partition primary format quick fs=ntfs label="Recovery image" assign letter="R" set id=27 list volume exit
CreateRecoveryPartitions-UEFI:
rem == CreateRecoveryPartitions-UEFI.txt == select disk 0 select partition 3 assign letter="W" rem == extend the Windows partition == shrink minimum=500 extend rem == b. Create space for the recovery tools shrink minimum=500 rem ** NOTE: Update this size to match the rem size of the recovery tools rem (winre.wim) ** rem === Create Recovery partition ====================== create partition primary format quick fs=ntfs label="Recovery" assign letter="R" set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" gpt attributes=0x8000000000000001 list volume exit
HideRecoveryPartitions-BIOS:
rem === HideRecoveryPartitions-BIOS.txt === select disk 0 select partition 3 set id=27 remove list volume exit
HideRecoveryPartitions-UEFI:
rem === HideRecoveryPartitions-UEFI.txt === select disk 0 select partition 4 set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac gpt attributes=0x8000000000000001 remove list volume exit
Bài viết có tham khảo một số thông tin từ trang chủ Microsoft. Bạn có thể copy các lệnh bên trên tại đây.
Xem thêm: