@@ -16,7 +16,7 @@ fltmc > nul 2>&1 || (
1616
1717reg 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!
3535echo 2. Enable Windows Updates !enableState!
3636echo 3. Exit
3737echo .
38- set /p choice = Select an option [1-3]:
38+ set /p choice = Select an option [1-3]:
3939
4040if " %choice% " == " 1" goto disable
4141if " %choice% " == " 2" goto enable
@@ -47,8 +47,22 @@ echo Disabling Windows Update service and scheduled tasks...
4747sc stop wuauserv > nul 2 >& 1
4848sc 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+
5055schtasks /Change /TN " Microsoft\Windows\WindowsUpdate\sih" /Disable > nul 2 >& 1
5156schtasks /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
5367reg 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...
6175sc config wuauserv start= demand > nul 2 >& 1
6276sc 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+
6483schtasks /Change /TN " Microsoft\Windows\WindowsUpdate\sih" /Enable > nul 2 >& 1
6584schtasks /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
6795reg 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
74102echo .
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):
76104if /i " %reboot% " == " Y" (
77105 shutdown /r /t 0
78106)
0 commit comments