From a05034381d71dcb567e9730de6b80cc2461f2c2a Mon Sep 17 00:00:00 2001 From: Gabi <182965942+GabiNun@users.noreply.github.com> Date: Fri, 13 Mar 2026 17:18:36 +0200 Subject: [PATCH] Update Win11 Creator (#4196) * Update autounattend.xml * Update autounattend.xml * Updated autounattend.xml to disable reccomened section * Update autounattend.xml --- tools/autounattend.xml | 52 +++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 34 deletions(-) diff --git a/tools/autounattend.xml b/tools/autounattend.xml index 1ba52b4d..91c2054b 100644 --- a/tools/autounattend.xml +++ b/tools/autounattend.xml @@ -333,27 +333,7 @@ $scripts = @( reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackDocs /t REG_DWORD /d 0 /f; }; { - Add-Type -TypeDefinition @" -using System; -using System.Runtime.InteropServices; -public class Win32Broadcast { - [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] - public static extern IntPtr SendMessageTimeout( - IntPtr hWnd, - uint Msg, - IntPtr wParam, - string lParam, - uint fuFlags, - uint uTimeout, - out IntPtr lpdwResult); -} -"@; - [Win32Broadcast]::SendMessageTimeout( [IntPtr]0xffff, 0x1A, [IntPtr]::Zero, 'ImmersiveColorSet', 0x2, 100, [ref]([IntPtr]::Zero) ); - }; - { - Get-Process -Name 'explorer' -ErrorAction 'SilentlyContinue' | Where-Object -FilterScript { - $_.SessionId -eq ( Get-Process -Id $PID ).SessionId; - } | Stop-Process -Force; + Restart-Computer -Force; }; ); @@ -434,15 +414,13 @@ $scripts = @( $scripts = @( - { - cmd.exe /c "rmdir C:\Windows.old"; - }; { Remove-Item -LiteralPath @( 'C:\Windows\Panther\unattend.xml'; 'C:\Windows\Panther\unattend-original.xml'; 'C:\Windows\Setup\Scripts\Wifi.xml'; - ) -Force -ErrorAction 'SilentlyContinue' -Verbose; + 'C:\Windows.old'; + ) -Recurse -Force -ErrorAction 'SilentlyContinue'; }; { reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /f; @@ -457,6 +435,14 @@ $scripts = @( reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\UsoSvc" /v Start /t REG_DWORD /d 2 /f; reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" /v Start /t REG_DWORD /d 3 /f; }; + { + reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Education" /f; + reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /f; + reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /f; + reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Education" /v IsEducationEnvironment /t REG_DWORD /d 1 /f; + reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v HideRecommendedSection /t REG_DWORD /d 1 /f; + reg.exe add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v HideRecommendedSection /t REG_DWORD /d 1 /f; + }; { $recallFeature = Get-WindowsOptionalFeature -Online -ErrorAction SilentlyContinue | Where-Object { $_.State -eq 'Enabled' -and $_.FeatureName -like 'Recall' }; if( $recallFeature ) { @@ -464,15 +450,13 @@ $scripts = @( } }; { - try { - $viveDir = Join-Path $env:TEMP 'ViVeTool'; - $viveZip = Join-Path $env:TEMP 'ViVeTool.zip'; - Invoke-WebRequest 'https://github.com/thebookisclosed/ViVe/releases/download/v0.3.4/ViVeTool-v0.3.4-IntelAmd.zip' -OutFile $viveZip; - Expand-Archive -Path $viveZip -DestinationPath $viveDir -Force; - Remove-Item -Path $viveZip -Force; - Start-Process -FilePath (Join-Path $viveDir 'ViVeTool.exe') -ArgumentList '/disable /id:47205210' -Wait -NoNewWindow; - Remove-Item -Path $viveDir -Recurse -Force; - } catch {} + $viveDir = Join-Path $env:TEMP 'ViVeTool'; + $viveZip = Join-Path $env:TEMP 'ViVeTool.zip'; + Invoke-WebRequest 'https://github.com/thebookisclosed/ViVe/releases/download/v0.3.4/ViVeTool-v0.3.4-IntelAmd.zip' -OutFile $viveZip; + Expand-Archive -Path $viveZip -DestinationPath $viveDir -Force; + Remove-Item -Path $viveZip -Force; + Start-Process -FilePath (Join-Path $viveDir 'ViVeTool.exe') -ArgumentList '/disable /id:47205210' -Wait -NoNewWindow; + Remove-Item -Path $viveDir -Recurse -Force; }; { if( (Get-BitLockerVolume -MountPoint $Env:SystemDrive).ProtectionStatus -eq 'On' ) {