moitinhdaukiss
Rìu Chiến Bạc Chấm
Đoạn mã này cụ thể thực hiện các thao tác gì vậy bạn?Đoạn mã nhỏ mình làm. Hy vọng có thể giúp bạn nếu sau này cài lại
Mã:@echo off mode con: cols=50 lines=20 Title Windows 10 Feature Updates NET SESSION >nul 2>&1 IF %ERRORLEVEL% EQU 0 ( ECHO you are Administrator ) ELSE ( ECHO You are NOT Administrator. ECHO Please Run as Administrator ... PING 127.0.0.1 > NUL 5>&1 EXIT /B 1 ) :Start Set Name="" Set Target="" Set Ver="" Set pv="" Set tv="" Set ti="" for /f "tokens=4" %%i in ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName') do set Name=Windows %%i for /f "tokens=3" %%i in ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId') do set Target=%%i for /f "tokens=3" %%i in ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v DisplayVersion') do set Ver=%%i for /f "tokens=4" %%i in ('Reg Query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v ProductVersion') do set pv=Windows %%i for /f "tokens=3" %%i in ('Reg Query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v TargetReleaseVersion') do set tv=%%i for /f "tokens=3" %%i in ('Reg Query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v TargetReleaseVersionInfo') do set ti=%%i cls if %Target% LSS "1803" goto :notSupport echo. echo --------------------------------------------- echo System Info [%Name%] - [%Target%] - [%Ver%] echo Update Info echo ProductVersion____________[%pv%] echo TargetReleaseVersion______[%tv%] echo TargetReleaseVersionInfo__[%ti%] echo. if "%tv%"=="0x1" ( CALL :ECHOBRED "--- Windows 10 Feature Updates - Turn OFF - Block ---" ) else ( CALL :ECHORED "--- Windows 10 Feature Updates - Turn ON - Not Block ---" ) echo. echo --------------------------------------------- echo [1] Block Windows Update echo [2] Unblock Windows Update echo [E] Exit echo --------------------------------------------- choice /C:12E /N set _el=%errorlevel% if %_el%==3 exit /b if %_el%==2 cls&goto :Delete if %_el%==1 cls&goto :Add goto :Start :Add REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v TargetReleaseVersion /t REG_DWORD /d "1" /f REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v ProductVersion /t REG_SZ /d "%Name%" /f REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v TargetReleaseVersionInfo /t REG_SZ /d "%Target%" /f Goto :Start :Delete REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v TargetReleaseVersion /f REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v ProductVersion /f REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v TargetReleaseVersionInfo /f Goto :Start :notSupport CALL:ECHORED "! ! ! CAN NOT SUPPORT THIS WINDOWS ! ! !" :ECHORED %Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Red %1 goto:eof :ECHOBRED %Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -backgroundcolor Red %1 goto:eof