mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-16 14:15:11 +08:00
32 lines
No EOL
710 B
Batchfile
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 |