Skip to content

Commit b33ced6

Browse files
committed
feat: pause updates & fix toggle (move to advanced)
1 parent 37f13f8 commit b33ced6

File tree

6 files changed

+151
-113
lines changed

6 files changed

+151
-113
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@echo off
2+
setlocal
3+
4+
set "settingName=PauseUpdates"
5+
set "stateValue=1"
6+
set "scriptPath=%~f0"
7+
8+
set "___args="%~f0" %*"
9+
fltmc > nul 2>&1 || (
10+
echo Administrator privileges are required.
11+
powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args"""" 2> nul || (
12+
echo You must run this script as admin.
13+
if "%*"=="" pause
14+
exit /b 1
15+
)
16+
exit /b
17+
)
18+
19+
if not "%~1"=="/silent" call "%windir%\AtlasModules\Scripts\serviceWarning.cmd" %*
20+
21+
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v state /t REG_DWORD /d %stateValue% /f >nul
22+
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f >nul
23+
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v days /t REG_DWORD /d 356000 /f >nul
24+
25+
echo Applying Windows Update pause policies...
26+
27+
reg add "HKLM\SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings" /v PausedFeatureStatus /t REG_DWORD /d 1 /f > nul
28+
reg add "HKLM\SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings" /v PausedQualityStatus /t REG_DWORD /d 1 /f > nul
29+
30+
set "_uxKey=HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings"
31+
reg add "%_uxKey%" /v FlightSettingsMaxPauseDays /t REG_DWORD /d 356000 /f > nul
32+
reg add "%_uxKey%" /v PauseFeatureUpdatesStartTime /t REG_SZ /d "2001-10-25T10:03:37Z" /f > nul
33+
reg add "%_uxKey%" /v PauseQualityUpdatesStartTime /t REG_SZ /d "2001-10-25T10:03:37Z" /f > nul
34+
reg add "%_uxKey%" /v PauseUpdatesStartTime /t REG_SZ /d "2001-10-25T10:03:37Z" /f > nul
35+
reg add "%_uxKey%" /v PauseFeatureUpdatesEndTime /t REG_SZ /d "3000-12-31T14:03:37Z" /f > nul
36+
reg add "%_uxKey%" /v PauseQualityUpdatesEndTime /t REG_SZ /d "3000-12-31T14:03:37Z" /f > nul
37+
reg add "%_uxKey%" /v PauseUpdatesExpiryTime /t REG_SZ /d "3000-12-31T14:03:37Z" /f > nul
38+
39+
reg add "%_uxKey%" /v HideMCTLink /t REG_DWORD /d 1 /f > nul
40+
reg add "%_uxKey%" /v RestartNotificationsAllowed2 /t REG_DWORD /d 0 /f > nul
41+
reg add "HKLM\SYSTEM\Setup\UpgradeNotification" /v UpgradeAvailable /t REG_DWORD /d 0 /f > nul
42+
43+
echo Done. Windows Update deferral has been set.
44+
if "%~1"=="/silent" exit /b
45+
pause
46+
47+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
@echo off
2+
setlocal
3+
4+
set "settingName=PauseUpdates"
5+
set "stateValue=0"
6+
set "scriptPath=%~f0"
7+
8+
set "___args="%~f0" %*"
9+
fltmc > nul 2>&1 || (
10+
echo Administrator privileges are required.
11+
powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args"""" 2> nul || (
12+
echo You must run this script as admin.
13+
if "%*"=="" pause
14+
exit /b 1
15+
)
16+
exit /b
17+
)
18+
19+
:main
20+
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v state /t REG_DWORD /d %stateValue% /f >nul
21+
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f >nul
22+
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v days /t REG_DWORD /d 0 /f >nul
23+
24+
echo Resetting Windows Update pause policies...
25+
26+
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdates /f >nul 2>&1
27+
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferFeatureUpdatesPeriodInDays /f >nul 2>&1
28+
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferQualityUpdates /f >nul 2>&1
29+
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DeferQualityUpdatesPeriodInDays /f >nul 2>&1
30+
31+
for %%K in (Feature Quality) do (
32+
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v Pause%%KUpdates /f > nul 2>&1
33+
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v Pause%%KUpdatesStartTime /f > nul 2>&1
34+
)
35+
36+
reg add "HKLM\SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings" /v PausedFeatureStatus /t REG_DWORD /d 0 /f > nul
37+
reg add "HKLM\SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings" /v PausedQualityStatus /t REG_DWORD /d 0 /f > nul
38+
39+
set "_uxKey=HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings"
40+
reg delete "%_uxKey%" /v PauseFeatureUpdatesStartTime /f > nul 2>&1
41+
reg delete "%_uxKey%" /v PauseFeatureUpdatesEndTime /f > nul 2>&1
42+
reg delete "%_uxKey%" /v PauseQualityUpdatesStartTime /f > nul 2>&1
43+
reg delete "%_uxKey%" /v PauseQualityUpdatesEndTime /f > nul 2>&1
44+
reg delete "%_uxKey%" /v PauseUpdatesStartTime /f > nul 2>&1
45+
reg delete "%_uxKey%" /v PauseUpdatesExpiryTime /f > nul 2>&1
46+
reg delete "%_uxKey%" /v PausedFeatureStatus /f > nul 2>&1
47+
reg delete "%_uxKey%" /v PausedQualityStatus /f > nul 2>&1
48+
reg delete "%_uxKey%" /v FlightSettingsMaxPauseDays /f > nul 2>&1
49+
50+
reg delete "%_uxKey%" /v HideMCTLink /f > nul 2>&1
51+
reg delete "%_uxKey%" /v RestartNotificationsAllowed2 /f > nul 2>&1
52+
reg delete "HKLM\SYSTEM\Setup\UpgradeNotification" /v UpgradeAvailable /f > nul 2>&1
53+
54+
echo Done. Windows Update pause policies have been reset to normal.
55+
if "%~1"=="/silent" exit /b
56+
pause

src/playbook/Executables/AtlasDesktop/3. General Configuration/Windows Updates/Reset Windows Update Deferral.cmd

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/playbook/Executables/AtlasDesktop/3. General Configuration/Windows Updates/Set Windows Update Deferral.cmd

Lines changed: 0 additions & 73 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
⚠️⚠️⚠️ WARNING: THIS FILE MAY CAUSE IRREVERIBLE ISSUES TO WINDOWS UPDATES
2+
USE WITH CAUTION ⚠️⚠️⚠️
3+
4+
‼️‼️‼️
5+
Users should use the file found at
6+
%windir%\AtlasDesktop\3. General Configuration\Pause Updates\Pause Windows Updates.cmd
7+
‼️‼️‼️
8+
9+
⚠️ This should only be used for Advanced Users who know what they are doing.
10+
11+
This file breaks:
12+
- Windows updates completely (Toggle will fix, but may fail [unlikely])
13+
- Microsoft store will no longer work
14+
- Will likely break xbox app updates (untested)
15+
16+
THIS SHOULD ONLY BE USED FOR THOSE WHO KNOW WHAT THEY ARE DOING AND KNOW THE RISKS
17+
Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fltmc > nul 2>&1 || (
1616

1717
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f > nul
1818

19-
for /f "tokens=3" %%a in ('sc qc wuauserv ^| findstr /i START_TYPE') do (
19+
for /f "tokens=4" %%a in ('sc qc wuauserv ^| findstr /i START_TYPE') do (
2020
set "WUState=%%a"
2121
)
2222

@@ -35,7 +35,7 @@ echo 1. Disable Windows Updates !disableState!
3535
echo 2. Enable Windows Updates !enableState!
3636
echo 3. Exit
3737
echo.
38-
set /p choice=Select an option [1-3]:
38+
set /p choice=Select an option [1-3]:
3939

4040
if "%choice%"=="1" goto disable
4141
if "%choice%"=="2" goto enable
@@ -47,8 +47,22 @@ echo Disabling Windows Update service and scheduled tasks...
4747
sc stop wuauserv >nul 2>&1
4848
sc config wuauserv start= disabled >nul 2>&1
4949

50+
sc stop UsoSvc >nul 2>&1
51+
sc config UsoSvc start= disabled >nul 2>&1
52+
reg add "HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" /v Start /t REG_DWORD /d 4 /f >nul 2>&1
53+
sc stop WaaSMedicSvc >nul 2>&1
54+
5055
schtasks /Change /TN "Microsoft\Windows\WindowsUpdate\sih" /Disable >nul 2>&1
5156
schtasks /Change /TN "Microsoft\Windows\WindowsUpdate\sihboot" /Disable >nul 2>&1
57+
schtasks /Change /TN "Microsoft\Windows\UpdateOrchestrator\Schedule Scan" /Disable >nul 2>&1
58+
schtasks /Change /TN "Microsoft\Windows\UpdateOrchestrator\USO_UxBroker" /Disable >nul 2>&1
59+
schtasks /Change /TN "Microsoft\Windows\UpdateOrchestrator\Reboot" /Disable >nul 2>&1
60+
61+
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWindowsUpdateAccess /t REG_DWORD /d 1 /f > nul
62+
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DoNotConnectToWindowsUpdateInternetLocations /t REG_DWORD /d 1 /f > nul
63+
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 1 /f > nul
64+
65+
call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /hide windowsupdate /silent
5266

5367
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v state /t REG_DWORD /d 0 /f > nul
5468

@@ -61,8 +75,22 @@ echo Enabling Windows Update service and scheduled tasks...
6175
sc config wuauserv start= demand >nul 2>&1
6276
sc start wuauserv >nul 2>&1
6377

78+
sc config UsoSvc start= demand >nul 2>&1
79+
sc start UsoSvc >nul 2>&1
80+
reg add "HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" /v Start /t REG_DWORD /d 3 /f >nul 2>&1
81+
sc start WaaSMedicSvc >nul 2>&1
82+
6483
schtasks /Change /TN "Microsoft\Windows\WindowsUpdate\sih" /Enable >nul 2>&1
6584
schtasks /Change /TN "Microsoft\Windows\WindowsUpdate\sihboot" /Enable >nul 2>&1
85+
schtasks /Change /TN "Microsoft\Windows\UpdateOrchestrator\Schedule Scan" /Enable >nul 2>&1
86+
schtasks /Change /TN "Microsoft\Windows\UpdateOrchestrator\USO_UxBroker" /Enable >nul 2>&1
87+
schtasks /Change /TN "Microsoft\Windows\UpdateOrchestrator\Reboot" /Enable >nul 2>&1
88+
89+
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWindowsUpdateAccess /f > nul 2>&1
90+
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DoNotConnectToWindowsUpdateInternetLocations /f > nul 2>&1
91+
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /f > nul 2>&1
92+
93+
call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /unhide windowsupdate
6694

6795
reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v state /t REG_DWORD /d 1 /f > nul
6896

@@ -72,7 +100,7 @@ goto :eof
72100

73101
:askReboot
74102
echo.
75-
set /p reboot=Would you like to reboot now to apply changes? (Y/N):
103+
set /p reboot=Would you like to reboot now to apply changes? (Y/N):
76104
if /i "%reboot%"=="Y" (
77105
shutdown /r /t 0
78106
)

0 commit comments

Comments
 (0)