Tools/enable or disable win10 update/enable win10 update.bat
2021-02-21 19:26:25 +09:00

32 lines
No EOL
710 B
Batchfile

@echo off
::set color
color DE
echo Checking administrator authority...
net session >nul 2>&1
if %errorLevel% == 0 (
goto continue
) else (
echo,
echo Please run me as an administrator!
echo Press any key to exit...
pause > nul
exit
)
:continue
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /ve 2>nul | findstr "WindowsUpdate" > nul
if %errorLevel% == 0 (
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f
echo The update of your system has been enabled.
echo Please restart your system!
) else (
echo The update of your system has been enabled!
)
echo Press any key to exit
pause > nul
exit