Skip to content

Commit a0b5b05

Browse files
committed
Pull in more changes from PRs agains origin
ntdevlabs#289
1 parent c58e26e commit a0b5b05

File tree

1 file changed

+51
-21
lines changed

1 file changed

+51
-21
lines changed

tiny11maker.ps1

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ Remove-Item -Path "$ScratchDisk\scratchdir\Windows\System32\OneDriveSetup.exe" -
218218
Write-Host "Removal complete!"
219219
Start-Sleep -Seconds 2
220220
Clear-Host
221+
222+
# Use for different entries behavior for 24H2
223+
Write-Host "Getting Windows version..."
224+
$windowsIs24H2 = reg query "HKLM\zSOFTWARE\Microsoft\Windows NT\CurrentVersion" /v DisplayVersion | Select-String -Pattern '24H2' -Quiet
225+
221226
Write-Host "Loading registry..."
222227
reg load HKLM\zCOMPONENTS $ScratchDisk\scratchdir\Windows\System32\config\COMPONENTS | Out-Null
223228
reg load HKLM\zDEFAULT $ScratchDisk\scratchdir\Windows\System32\config\default | Out-Null
@@ -262,7 +267,9 @@ Write-Host "Disabling Sponsored Apps:"
262267
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\PushToInstall' '/v' 'DisablePushToInstall' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
263268
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\MRT' '/v' 'DontOfferThroughWUAU' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
264269
& 'reg' 'delete' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\Subscriptions' '/f' | Out-Null
265-
& 'reg' 'delete' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\SuggestedApps' '/f' | Out-Null
270+
if (!$windowsIs24H2) {
271+
& 'reg' 'delete' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\SuggestedApps' '/f' | Out-Null
272+
}
266273
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' '/v' 'DisableConsumerAccountStateContent' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
267274
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' '/v' 'DisableCloudOptimizedContent' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
268275
Write-Host "Enabling Local Accounts on OOBE:"
@@ -391,29 +398,52 @@ Write-Host "Permissions modified for Administrators group."
391398
Write-Host "Registry key permissions successfully updated."
392399
$regKey.Close()
393400

394-
Write-Host 'Deleting Application Compatibility Appraiser'
395-
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{0600DD45-FAF2-4131-A006-0B17509B9F78}" /f | Out-Null
396-
Write-Host 'Deleting Customer Experience Improvement Program'
397-
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{4738DE7A-BCC1-4E2D-B1B0-CADB044BFA81}" /f | Out-Null
398-
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{6FAC31FA-4A85-4E64-BFD5-2154FF4594B3}" /f | Out-Null
399-
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{FC931F16-B50A-472E-B061-B6F79A71EF59}" /f | Out-Null
400-
Write-Host 'Deleting Program Data Updater'
401-
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{0671EB05-7D95-4153-A32B-1426B9FE61DB}" /f | Out-Null
402-
Write-Host 'Deleting autochk proxy'
403-
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{87BF85F4-2CE1-4160-96EA-52F554AA28A2}" /f | Out-Null
404-
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{8A9C643C-3D74-4099-B6BD-9C6D170898B1}" /f | Out-Null
405-
Write-Host 'Deleting QueueReporting'
406-
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{E3176A65-4E44-4ED3-AA73-3283660ACB9C}" /f | Out-Null
407-
Write-Host "Tweaking complete!"
408-
Write-Host "Unmounting Registry..."
401+
# Entry name is different for 24H2
402+
if ($windowsIs24H2) {
403+
Write-Host 'Deleting Application Compatibility Appraiser'
404+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{3047C197-66F1-4523-BA92-6C955FEF9E4E}" /f | Out-Null
405+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{A0C71CB8-E8F0-498A-901D-4EDA09E07FF4}" /f | Out-Null
406+
Write-Host 'Deleting Customer Experience Improvement Program'
407+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{780E487D-C62F-4B55-AF84-0E38116AFE07}" /f | Out-Null
408+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{FD607F42-4541-418A-B812-05C32EBA8626}" /f | Out-Null
409+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{E4FED5BC-D567-4044-9642-2EDADF7DE108}" /f | Out-Null
410+
Write-Host 'Deleting Program Data Updater'
411+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{E292525C-72F1-482C-8F35-C513FAA98DAE}" /f | Out-Null
412+
Write-Host 'Deleting autochk proxy'
413+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{30E6DB3D-C3AA-44DA-8E88-9DB52D84975E}" /f | Out-Null
414+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{7235AFD9-C139-458E-AA61-F6FD579A198F}" /f | Out-Null
415+
Write-Host 'Deleting QueueReporting'
416+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{6FD85B93-7A13-4DCA-B793-1D7D18FEAC39}" /f | Out-Null
417+
Write-Host "Tweaking complete!"
418+
Write-Host "Unmounting Registry..."
419+
} else {
420+
Write-Host 'Deleting Application Compatibility Appraiser'
421+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{0600DD45-FAF2-4131-A006-0B17509B9F78}" /f | Out-Null
422+
Write-Host 'Deleting Customer Experience Improvement Program'
423+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{4738DE7A-BCC1-4E2D-B1B0-CADB044BFA81}" /f | Out-Null
424+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{6FAC31FA-4A85-4E64-BFD5-2154FF4594B3}" /f | Out-Null
425+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{FC931F16-B50A-472E-B061-B6F79A71EF59}" /f | Out-Null
426+
Write-Host 'Deleting Program Data Updater'
427+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{0671EB05-7D95-4153-A32B-1426B9FE61DB}" /f | Out-Null
428+
Write-Host 'Deleting autochk proxy'
429+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{87BF85F4-2CE1-4160-96EA-52F554AA28A2}" /f | Out-Null
430+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{8A9C643C-3D74-4099-B6BD-9C6D170898B1}" /f | Out-Null
431+
Write-Host 'Deleting QueueReporting'
432+
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{E3176A65-4E44-4ED3-AA73-3283660ACB9C}" /f | Out-Null
433+
Write-Host "Tweaking complete!"
434+
Write-Host "Unmounting Registry..."
435+
}
409436
$regKey.Close()
437+
410438
reg unload HKLM\zCOMPONENTS | Out-Null
411-
reg unload HKLM\zDRIVERS | Out-Null
412439
reg unload HKLM\zDEFAULT | Out-Null
413440
reg unload HKLM\zNTUSER | Out-Null
414-
reg unload HKLM\zSCHEMA | Out-Null
415-
reg unload HKLM\zSOFTWARE
441+
reg unload HKLM\zSOFTWARE | Out-Null
416442
reg unload HKLM\zSYSTEM | Out-Null
443+
# Keeping these commented out for now, as they are not needed for the script to work in current windows version.
444+
# reg unload HKLM\zDRIVERS | Out-Null
445+
# reg unload HKLM\zSCHEMA | Out-Null
446+
417447
Write-Host "Cleaning up image..."
418448
Repair-WindowsImage -Path $ScratchDisk\scratchdir -StartComponentCleanup -ResetBase
419449
Write-Host "Cleanup complete."
@@ -455,10 +485,10 @@ Write-Host "Tweaking complete!"
455485
Write-Host "Unmounting Registry..."
456486
$regKey.Close()
457487
reg unload HKLM\zCOMPONENTS | Out-Null
458-
reg unload HKLM\zDRIVERS | Out-Null
459488
reg unload HKLM\zDEFAULT | Out-Null
460489
reg unload HKLM\zNTUSER | Out-Null
461-
reg unload HKLM\zSCHEMA | Out-Null
490+
# reg unload HKLM\zDRIVERS | Out-Null
491+
# reg unload HKLM\zSCHEMA | Out-Null
462492
$regKey.Close()
463493
reg unload HKLM\zSOFTWARE
464494
reg unload HKLM\zSYSTEM | Out-Null

0 commit comments

Comments
 (0)