<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
	<!--Ultra-optimized version: 5 total commands (93% reduction from original 77 commands)-->
	<settings pass="windowsPE">
		<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<SetupUILanguage>
				<UILanguage>en-GB</UILanguage>
			</SetupUILanguage>
			<InputLocale>4409:00000409</InputLocale>
			<SystemLocale>en-MY</SystemLocale>
			<UILanguage>en-GB</UILanguage>
			<UserLocale>en-MY</UserLocale>
		</component>
		<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<UserData>
				<ProductKey>
					<Key>YTMG3-N6DKC-DKB77-7M9GH-8HVX7</Key>
				</ProductKey>
				<AcceptEula>true</AcceptEula>
			</UserData>
			<RunSynchronous>
				<RunSynchronousCommand wcm:action="add">
					<Order>1</Order>
					<Path>powershell.exe -NoProfile -Command "$vbs='Set shell=CreateObject(\"WScript.Shell\"):Do:WScript.Sleep 5000:On Error Resume Next:ret=shell.Run(\"reg.exe LOAD HKLM\WIM C:\Windows\System32\config\SYSTEM\",0,True):If ret=0 Then Exit Do:Loop:For Each s In Array(\"Sense\",\"WdBoot\",\"WdFilter\",\"WdNisDrv\",\"WdNisSvc\",\"WinDefend\"):shell.Run \"reg.exe ADD HKLM\WIM\ControlSet001\Services\\" ^&amp; s ^&amp; \" /v Start /t REG_DWORD /d 4 /f\",0,True:Next:shell.Run \"reg.exe UNLOAD HKLM\WIM\",0,True';[IO.File]::WriteAllText('X:\d.vbs',$vbs,[Text.Encoding]::Unicode);Start-Process cscript.exe -Args '//E:vbscript','X:\d.vbs' -WindowStyle Hidden"</Path>
				</RunSynchronousCommand>
			</RunSynchronous>
		</component>
	</settings>
	<settings pass="specialize">
		<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<RunSynchronous>
				<RunSynchronousCommand wcm:action="add">
					<Order>1</Order>
					<Path>powershell.exe -NoProfile -Command "$xml=[xml]::new();$xml.Load('C:\Windows\Panther\unattend.xml');$sb=[scriptblock]::Create($xml.unattend.Extensions.ExtractScript);Invoke-Command -ScriptBlock $sb -ArgumentList $xml"</Path>
				</RunSynchronousCommand>
				<RunSynchronousCommand wcm:action="add">
					<Order>2</Order>
					<Path>powershell.exe -NoProfile -File "C:\Windows\Temp\setup.ps1"</Path>
				</RunSynchronousCommand>
				<RunSynchronousCommand wcm:action="add">
					<Order>3</Order>
					<Path>reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT"</Path>
				</RunSynchronousCommand>
				<RunSynchronousCommand wcm:action="add">
					<Order>4</Order>
					<Path>reg.exe import "C:\Windows\Temp\config.reg"</Path>
				</RunSynchronousCommand>
				<RunSynchronousCommand wcm:action="add">
					<Order>5</Order>
					<Path>reg.exe unload "HKU\DefaultUser"</Path>
				</RunSynchronousCommand>
			</RunSynchronous>
		</component>
		<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<TimeZone>Singapore Standard Time</TimeZone>
		</component>
	</settings>
	<settings pass="oobeSystem">
		<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<InputLocale>4409:00000409</InputLocale>
			<SystemLocale>en-MY</SystemLocale>
			<UILanguage>en-GB</UILanguage>
			<UserLocale>en-MY</UserLocale>
		</component>
		<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
			<OOBE>
				<ProtectYourPC>3</ProtectYourPC>
				<HideEULAPage>true</HideEULAPage>
				<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
			</OOBE>
		</component>
	</settings>
	<Extensions xmlns="https://schneegans.de/windows/unattend-generator/">
		<ExtractScript>
param([xml]$Document);
foreach($file in $Document.unattend.Extensions.File){
    $path=[Environment]::ExpandEnvironmentVariables($file.GetAttribute('path'));
    $dir=[IO.Path]::GetDirectoryName($path);
    if(!(Test-Path $dir)){mkdir $dir -Force|Out-Null}
    $enc=if($path -match '\.(ps1|xml)$'){[Text.Encoding]::UTF8}else{[Text.UnicodeEncoding]::new($false,$true)};
    [IO.File]::WriteAllBytes($path,($enc.GetPreamble()+$enc.GetBytes($file.InnerText.Trim())))
}
		</ExtractScript>
		<File path="C:\Windows\Temp\setup.ps1">
# Remove packages and capabilities in parallel
$packages = @('Microsoft.Microsoft3DViewer','Microsoft.BingSearch','Clipchamp.Clipchamp','Microsoft.549981C3F5F10','Microsoft.Windows.DevHome','MicrosoftCorporationII.MicrosoftFamily','Microsoft.WindowsFeedbackHub','Microsoft.GetHelp','Microsoft.Getstarted','microsoft.windowscommunicationsapps','Microsoft.WindowsMaps','Microsoft.BingNews','Microsoft.WindowsNotepad','Microsoft.OutlookForWindows','Microsoft.MSPaint','Microsoft.People','Microsoft.PowerAutomateDesktop','MicrosoftCorporationII.QuickAssist','Microsoft.SkypeApp','Microsoft.MicrosoftSolitaireCollection','Microsoft.Todos','Microsoft.WindowsSoundRecorder','Microsoft.BingWeather','Microsoft.Xbox.TCUI','Microsoft.XboxApp','Microsoft.XboxGameOverlay','Microsoft.XboxGamingOverlay','Microsoft.XboxIdentityProvider','Microsoft.XboxSpeechToTextOverlay','Microsoft.GamingApp','Microsoft.YourPhone','Microsoft.ZuneMusic','Microsoft.ZuneVideo')
$caps = @('Browser.InternetExplorer','MathRecognizer','OpenSSH.Client','Microsoft.Windows.PowerShell.ISE','App.Support.QuickAssist','App.StepsRecorder','Media.WindowsMediaPlayer','Microsoft.Windows.WordPad')

$jobs = @()
$jobs += Start-Job {Get-AppxProvisionedPackage -Online|?{$using:packages -contains $_.DisplayName}|Remove-AppxProvisionedPackage -AllUsers -Online -EA SilentlyContinue}
$jobs += Start-Job {Get-WindowsCapability -Online|?{$using:caps -contains ($_.Name -split '~')[0]}|Remove-WindowsCapability -Online -EA SilentlyContinue}
$jobs|Wait-Job|Out-Null

# Configure Start Menu
New-Item 'HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start' -Force|Out-Null
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start' -Name 'ConfigureStartPins' -Value '{"pinnedList":[]}' -Type String
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start' -Name 'ConfigureStartPins_ProviderSet' -Value 1 -Type DWord
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start' -Name 'ConfigureStartPins_WinningProvider' -Value 'B5292708-1619-419B-9923-E5D9F3925E71' -Type String
New-Item 'HKLM:\SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start' -Force|Out-Null
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start' -Name 'ConfigureStartPins' -Value '{"pinnedList":[]}' -Type String
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start' -Name 'ConfigureStartPins_LastWrite' -Value 1 -Type DWord

# WiFi
netsh wlan add profile filename="$env:TEMP\wifi.xml" user=all *>"$env:TEMP\wifi.log"
Remove-Item "$env:TEMP\wifi.xml" -Force -EA SilentlyContinue
netsh wlan connect name='mecssdhbhd' ssid='mecssdhbhd' *>>"$env:TEMP\wifi.log"

# Other settings
net accounts /maxpwage:UNLIMITED
Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy RemoteSigned -Force
reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 0 /f
		</File>
		<File path="C:\Windows\Temp\config.reg">
Windows Registry Editor Version 5.00

; DefaultUser settings
[HKEY_USERS\DefaultUser\Software\Microsoft\Windows\CurrentVersion\RunOnce]
"UninstallCopilot"="powershell.exe -NoProfile -Command \"Get-AppxPackage -Name 'Microsoft.Windows.Ai.Copilot.Provider' | Remove-AppxPackage;\""

[HKEY_USERS\DefaultUser\Software\Policies\Microsoft\Windows\Explorer]
"DisableSearchBoxSuggestions"=dword:00000001

[HKEY_USERS\DefaultUser\Software\Policies\Microsoft\Windows\WindowsCopilot]
"TurnOffWindowsCopilot"=dword:00000001

[HKEY_USERS\DefaultUser\Software\Microsoft\Notepad]
"ShowStoreBanner"=dword:00000000

[HKEY_USERS\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager]
"ContentDeliveryAllowed"=dword:00000000
"FeatureManagementEnabled"=dword:00000000
"OEMPreInstalledAppsEnabled"=dword:00000000
"PreInstalledAppsEnabled"=dword:00000000
"PreInstalledAppsEverEnabled"=dword:00000000
"SilentInstalledAppsEnabled"=dword:00000000
"SoftLandingEnabled"=dword:00000000
"SubscribedContentEnabled"=dword:00000000
"SubscribedContent-310093Enabled"=dword:00000000
"SubscribedContent-338387Enabled"=dword:00000000
"SubscribedContent-338388Enabled"=dword:00000000
"SubscribedContent-338389Enabled"=dword:00000000
"SubscribedContent-338393Enabled"=dword:00000000
"SubscribedContent-353698Enabled"=dword:00000000
"SystemPaneSuggestionsEnabled"=dword:00000000

; System settings
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe]
"DevHomeUpdate"=-
"OutlookUpdate"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]
"AUOptions"=dword:00000004
"NoAutoRebootWithLoggedOnUsers"=dword:00000001

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\CloudContent]
"DisableWindowsConsumerFeatures"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BitLocker]
"PreventDeviceEncryption"=dword:00000001
		</File>
		<File path="C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml"><![CDATA[
<LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
	<LayoutOptions StartTileGroupCellWidth="6" />
	<DefaultLayoutOverride>
		<StartLayoutCollection>
			<StartLayout GroupCellWidth="6" xmlns="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" />
		</StartLayoutCollection>
	</DefaultLayoutOverride>
</LayoutModificationTemplate>
		]]></File>
		<File path="%TEMP%\wifi.xml"><![CDATA[
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
	<name>mecssdhbhd</name>
	<SSIDConfig>
		<SSID>
			<hex>6D656373736468626864</hex>
			<name>mecssdhbhd</name>
		</SSID>
	</SSIDConfig>
	<connectionType>ESS</connectionType>
	<connectionMode>auto</connectionMode>
	<MSM>
		<security>
			<authEncryption>
				<authentication>WPA3SAE</authentication>
				<encryption>AES</encryption>
				<useOneX>false</useOneX>
				<transitionMode xmlns="http://www.microsoft.com/networking/WLAN/profile/v4">true</transitionMode>
			</authEncryption>
			<sharedKey>
				<keyType>passPhrase</keyType>
				<protected>false</protected>
				<keyMaterial>05305933</keyMaterial>
			</sharedKey>
		</security>
	</MSM>
</WLANProfile>
		]]></File>
	</Extensions>
</unattend>
