diff --git a/scripts/unattend/autounattend.xml b/scripts/unattend/autounattend.xml index 31232e3..a0567a7 100644 --- a/scripts/unattend/autounattend.xml +++ b/scripts/unattend/autounattend.xml @@ -1,6 +1,6 @@ - + @@ -23,7 +23,7 @@ - 00000-00000-00000-00000-00000 + VK7JG-NPHTM-C97JM-9MPGT-3V66T true @@ -58,114 +58,94 @@ 8 - cmd.exe /c ">>"X:\diskpart.txt" echo SHRINK MINIMUM=1000" - - - 9 cmd.exe /c ">>"X:\diskpart.txt" echo FORMAT QUICK FS=NTFS LABEL="Windows"" - 10 - cmd.exe /c ">>"X:\diskpart.txt" echo CREATE PARTITION PRIMARY" - - - 11 - cmd.exe /c ">>"X:\diskpart.txt" echo FORMAT QUICK FS=NTFS LABEL="Recovery"" - - - 12 - cmd.exe /c ">>"X:\diskpart.txt" echo SET ID="de94bba4-06d1-4d40-a16a-bfd50179d6ac"" - - - 13 - cmd.exe /c ">>"X:\diskpart.txt" echo GPT ATTRIBUTES=0x8000000000000001" - - - 14 + 9 cmd.exe /c "diskpart.exe /s "X:\diskpart.txt" >>"X:\diskpart.log" || ( type "X:\diskpart.log" & echo diskpart encountered an error. & pause & exit /b 1 )" - 15 + 10 reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f - 16 + 11 reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f - 17 + 12 reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f - 18 + 13 cmd.exe /c ">>"X:\disable-defender.cmd" echo @ECHO OFF" - 19 + 14 cmd.exe /c ">>"X:\disable-defender.cmd" echo SET file=C:\$Windows.~BT\NewOS\Windows\System32\config\SYSTEM" - 20 + 15 cmd.exe /c ">>"X:\disable-defender.cmd" echo FOR /L ^%^%i IN (0) DO (" - 21 + 16 cmd.exe /c ">>"X:\disable-defender.cmd" echo CALL :sleep" - 22 + 17 cmd.exe /c ">>"X:\disable-defender.cmd" echo IF EXIST ^%file^% (" - 23 + 18 cmd.exe /c ">>"X:\disable-defender.cmd" echo CALL :load" - 24 + 19 cmd.exe /c ">>"X:\disable-defender.cmd" echo FOR ^%^%s IN (Sense WdBoot WdFilter WdNisDrv WdNisSvc WinDefend) DO reg.exe ADD HKLM\mount\ControlSet001\Services\^%^%s /v Start /t REG_DWORD /d 4 /f" - 25 + 20 cmd.exe /c ">>"X:\disable-defender.cmd" echo reg.exe UNLOAD HKLM\mount" - 26 + 21 cmd.exe /c ">>"X:\disable-defender.cmd" echo EXIT ) )" - 27 + 22 cmd.exe /c ">>"X:\disable-defender.cmd" echo GOTO :eof" - 28 + 23 cmd.exe /c ">>"X:\disable-defender.cmd" echo :load" - 29 + 24 cmd.exe /c ">>"X:\disable-defender.cmd" echo reg.exe LOAD HKLM\mount ^%file^%" - 30 + 25 cmd.exe /c ">>"X:\disable-defender.cmd" echo IF ^%errorlevel^% GTR 0 GOTO load" - 31 + 26 cmd.exe /c ">>"X:\disable-defender.cmd" echo GOTO :eof" - 32 + 27 cmd.exe /c ">>"X:\disable-defender.cmd" echo :sleep" - 33 + 28 cmd.exe /c ">>"X:\disable-defender.cmd" echo ping.exe -n 1 127.0.0.1 ^> NUL" - 34 + 29 cmd.exe /c ">>"X:\disable-defender.cmd" echo GOTO :eof" - 35 + 30 cmd.exe /c "start /MIN X:\disable-defender.cmd" @@ -185,7 +165,7 @@ 3 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Runonce" /v "UninstallCopilot" /t REG_SZ /d "powershell.exe -NoProfile -Command \"Get-AppxPackage -Name 'Microsoft.Windows.Ai.Copilot.Provider' | Remove-AppxPackage;\"" /f + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "UninstallCopilot" /t REG_SZ /d "powershell.exe -NoProfile -Command \"Get-AppxPackage -Name 'Microsoft.Windows.Ai.Copilot.Provider' | Remove-AppxPackage;\"" /f 4 @@ -309,128 +289,148 @@ 34 - regini.exe "%TEMP%\disable-defender.ini" + reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT" 35 - reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\CI\Policy" /v VerifiedAndReputablePolicyState /t REG_DWORD /d 0 /f + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer" /v EnableAutoTray /t REG_DWORD /d 0 /f 36 - reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Run" /v "ShowAllTrayIcons" /t REG_SZ /d "powershell.exe -NoProfile -Command \"Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\ShowAllTrayIcons.ps1' -Raw | Invoke-Expression;\"" /f 37 - reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f - - - 38 - netsh.exe advfirewall firewall set rule group="@FirewallAPI.dll,-28752" new enable=Yes - - - 39 - reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f - - - 40 - powershell.exe -NoProfile -Command "Set-ExecutionPolicy -Scope 'LocalMachine' -ExecutionPolicy 'RemoteSigned' -Force;" - - - 41 - fsutil.exe behavior set disableLastAccess 1 - - - 42 - reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Dsh" /v AllowNewsAndInterests /t REG_DWORD /d 0 /f - - - 43 - reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT" - - - 44 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "ContentDeliveryAllowed" /t REG_DWORD /d 0 /f - - - 45 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "FeatureManagementEnabled" /t REG_DWORD /d 0 /f - - - 46 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "OEMPreInstalledAppsEnabled" /t REG_DWORD /d 0 /f - - - 47 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEnabled" /t REG_DWORD /d 0 /f - - - 48 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEverEnabled" /t REG_DWORD /d 0 /f - - - 49 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d 0 /f - - - 50 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SoftLandingEnabled" /t REG_DWORD /d 0 /f - - - 51 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContentEnabled" /t REG_DWORD /d 0 /f - - - 52 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-310093Enabled" /t REG_DWORD /d 0 /f - - - 53 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338387Enabled" /t REG_DWORD /d 0 /f - - - 54 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338388Enabled" /t REG_DWORD /d 0 /f - - - 55 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0 /f - - - 56 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338393Enabled" /t REG_DWORD /d 0 /f - - - 57 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-353698Enabled" /t REG_DWORD /d 0 /f - - - 58 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 0 /f - - - 59 reg.exe unload "HKU\DefaultUser" - 60 - reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 0 /f + 38 + regini.exe "%TEMP%\disable-defender.ini" - 61 - reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\BitLocker" /v "PreventDeviceEncryption" /t REG_DWORD /d 1 /f + 39 + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\CI\Policy" /v VerifiedAndReputablePolicyState /t REG_DWORD /d 0 /f - 62 + 40 + reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f + + + 41 + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f + + + 42 + netsh.exe advfirewall firewall set rule group="@FirewallAPI.dll,-28752" new enable=Yes + + + 43 + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f + + + 44 + powershell.exe -NoProfile -Command "Set-ExecutionPolicy -Scope 'LocalMachine' -ExecutionPolicy 'RemoteSigned' -Force;" + + + 45 + fsutil.exe behavior set disableLastAccess 1 + + + 46 + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 0 /f + + + 47 + reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Dsh" /v AllowNewsAndInterests /t REG_DWORD /d 0 /f + + + 48 reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT" + + 49 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "ContentDeliveryAllowed" /t REG_DWORD /d 0 /f + + + 50 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "FeatureManagementEnabled" /t REG_DWORD /d 0 /f + + + 51 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "OEMPreInstalledAppsEnabled" /t REG_DWORD /d 0 /f + + + 52 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEnabled" /t REG_DWORD /d 0 /f + + + 53 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEverEnabled" /t REG_DWORD /d 0 /f + + + 54 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d 0 /f + + + 55 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SoftLandingEnabled" /t REG_DWORD /d 0 /f + + + 56 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContentEnabled" /t REG_DWORD /d 0 /f + + + 57 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-310093Enabled" /t REG_DWORD /d 0 /f + + + 58 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338387Enabled" /t REG_DWORD /d 0 /f + + + 59 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338388Enabled" /t REG_DWORD /d 0 /f + + + 60 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0 /f + + + 61 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338393Enabled" /t REG_DWORD /d 0 /f + + + 62 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-353698Enabled" /t REG_DWORD /d 0 /f + 63 - reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Runonce" /v "ClassicContextMenu" /t REG_SZ /d "reg.exe add \"HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32\" /ve /f" /f + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 0 /f 64 reg.exe unload "HKU\DefaultUser" + + 65 + reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 0 /f + + + 66 + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\BitLocker" /v "PreventDeviceEncryption" /t REG_DWORD /d 1 /f + + + 67 + reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT" + + + 68 + reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "ClassicContextMenu" /t REG_SZ /d "reg.exe add \"HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32\" /ve /f" /f + + + 69 + reg.exe unload "HKU\DefaultUser" + @@ -683,6 +683,12 @@ $logfile = 'C:\Windows\Temp\remove-features.log'; ]]> + +Set-Location -LiteralPath 'HKCU:\'; +Get-Item -Path 'HKCU:\Control Panel\NotifyIconSettings\*' -ErrorAction 'SilentlyContinue' | ForEach-Object -Process { + $_ | Set-ItemProperty -Name 'IsPromoted' -Value 1 -Type 'DWord'; +}; + HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sense "Start" = REG_DWORD 4