윈도우 10 자동업데이트 끄기/켜기 CMD명령어 파일

일반 2017. 7. 19. 14:59
반응형

윈도우10은 기본적으로 자동업데이트를 끄게끔 선택할 수 없습니다. 

아래 CMD파일을 사용하면 자동업데이트를 쉽게 끌 수 있습니다.


Auto-Update-Enable_Disable-Win10.cmd



자동업데이트 비활성화 한 모습



자동업데이트 비활성화 과정



자동업데이트 재활성화 과정


아래는 CMD파일내 명령 구문입니다.


@echo off


title Disable/Enable Windows 10 Automatic Updates

color 1f

:Begin UAC check and Auto-Elevate Permissions

:-------------------------------------

REM  --> Check for permissions

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"


REM --> If error flag set, we do not have admin.

if '%errorlevel%' NEQ '0' (

echo:

echo   Requesting Administrative Privileges...

echo   Press YES in UAC Prompt to Continue

echo:


    goto UACPrompt

) else ( goto gotAdmin )


:UACPrompt

    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"

    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"


    "%temp%\getadmin.vbs"

    exit /B


:gotAdmin

    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )

    pushd "%CD%"

    CD /D "%~dp0"

:--------------------------------------


:Check Windows Version

wmic os get version | find /i "10.">nul 2>nul

if %errorlevel% neq 0 GOTO :Not10


:Check the key:

(reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate"|find /i "0x1")>NUL 2>NUL

if %errorlevel% neq 0 GOTO :KEYOFF


:KEYON

echo ============================================================

echo Automatic Updates are currently disabled.

echo Would you like to re-enable them? (Y/N)

echo ============================================================

echo.

choice /c yn /n

If %ERRORLEVEL% NEQ 1 GOTO :QUIT


echo Attempting to shut down the Windows Update service if it's running

net stop wuauserv>NUL 2>NUL

echo.


Echo Changing Registry key

REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /D 0 /T REG_DWORD /F>NUL 2>NUL

IF %ERRORLEVEL% NEQ 0 GOTO :ERROR

Echo.


Echo Automatic Updates have been enabled

Echo.

goto :QUIT



:KEYOFF

echo ============================================================

echo Automatic Updates are currently enabled.

echo Would you like to disable them? (Y/N)

echo ============================================================

echo.

choice /c yn /n

If %ERRORLEVEL% NEQ 1 GOTO :QUIT


echo Attempting to shut down the Windows Update service if it's running

net stop wuauserv>NUL 2>NUL

echo.


Echo Changing Registry key

REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /D 1 /T REG_DWORD /F>NUL 2>NUL

IF %ERRORLEVEL% NEQ 0 GOTO :ERROR

Echo.


Echo Automatic Updates have been disabled

Echo.

goto :QUIT



:QUIT

echo ============================================================

echo Press any key to exit...

echo ============================================================

pause>NUL

goto :EOF


:ERROR

echo ============================================================

echo The script ran into an unexpected error setting reg key.

echo Press any key to exit...

echo ============================================================

pause>NUL

goto :EOF


:Not10

echo ============================================================

echo This script is only designed for Windows 10...

echo Press any key to exit...

echo ============================================================

pause>NUL

goto :EOF

반응형

설정

트랙백

댓글