Prevent the application upgrade to Windows 10

Discussion in 'Scripting' started by clavafede, Sep 16, 2015.

  1. clavafede

    clavafede MDL Novice

    Jul 12, 2011
    9
    0
    0
    Hello guys , I'm looking for a script that can prevent the annoying notification to upgrade Windows 8/7 to Windows 10 .Ideas ??:g:
     
  2. SOCRATE_MMXII

    SOCRATE_MMXII MDL Expert

    Jan 25, 2012
    1,033
    318
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,575
    15,646
    270
    Easier and effective script thanks to abbodi1406
    According to him, install them all (updates) and disable what they provide (DiagTrack service, Schedule Tasks, reg policy to prevent GWX and upgrade)No issues or adverse effects so far.

    Launch your notepad and copy-paste the next code, then save as <anynameyoulike>.cmd
    Then right click and run as admin:
    Code:
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\Gwx /f /v DisableGwx /t REG_DWORD /d 1
    
    
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v DisableOSUpgrade /t REG_DWORD /d 1
    
    
    schtasks /Change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE
    schtasks /Change /TN "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE
    schtasks /Change /TN "\Microsoft\Windows\Application Experience\AitAgent" /DISABLE
    
    
    schtasks /Change /TN "\Microsoft\Windows\Setup\gwx\launchtrayprocess" /DISABLE
    schtasks /Change /TN "\Microsoft\Windows\Setup\gwx\refreshgwxconfig" /DISABLE
    schtasks /Change /TN "\Microsoft\Windows\Setup\gwx\refreshgwxconfigandcontent" /DISABLE
    schtasks /Change /TN "\Microsoft\Windows\Setup\gwx\refreshgwxcontent" /DISABLE
    
    
    sc config DiagTrack start= disabled
    net stop DiagTrack
    http://forums.mydigitallife.net/thr...om-Windows-7?p=1142667&viewfull=1#post1142667
     
  4. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    7,897
    10,733
    240
    yep Mr. X thanks a lot for you and abbodi1406 very usefull :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. clavafede

    clavafede MDL Novice

    Jul 12, 2011
    9
    0
    0
    #5 clavafede, Nov 28, 2015
    Last edited: Nov 28, 2015
    (OP)
    This script removes the tedious warning but not prevents . It only remains to hide the update KB3035583 ?
     
  6. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #6 Smorgan, Dec 4, 2015
    Last edited by a moderator: Apr 20, 2017
    You will need to use either dism or wusa to remove the update. In this case I would say dism is the better option as has been agreed to by the forum.

    Open up cmd as admin and keep it open:

    Code:
    cd %userprofile%\Desktop
    dism /online /get-packages >patches.txt
    
    Now open the patches.txt file and use control-F and type 3035583.

    Code:
    DISM /Online /Remove-Package /PackageName:(name here) /quiet /norestart
    It should look like this:

    Package_for_KB3035583~31bf3856ad364e35~amd64~~6.3.1.0 (Make sure)

    Socrates stop being lazy.
     
  7. mysteriously

    mysteriously Guest

    #7 mysteriously, Mar 16, 2016
    Last edited by a moderator: Apr 20, 2017
    Uninstall GWX&Restart.cmd

    Code:
    @echo off&cls&title Uninstall GWX
    
    cd /d %windir%\system32\
    
    :adminCheck
    FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
    IF (%adminTest%)==(Access) goto noAdmin
    goto :checkOS
    
    :noAdmin
    echo.
    echo Run this batch as admin!
    echo.
    pause
    goto :end
    
    :checkOS
    setlocal
    for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
    if "%version%" == "6.1" goto :win7
    echo.
    echo You're NOT running Windows 7. The batch will NOT continue.
    echo.
    goto :end
    
    :win7
    endlocal
    echo.
    echo You're running Windows 7. The batch will continue.
    echo.
    echo Batch checks if GWX update is installed,
    echo prevents upgrading to Windows 10
    echo and reboots the PC
    echo.
    goto :addToRegistry
    
    :addToRegistry
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\Gwx /v DisableGwx /t REG_DWORD /d 1 /f
    reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v DisableOSUpgrade /t REG_DWORD /d 1 /f
    echo.
    echo Registry entries have been added.
    echo.
    goto :checkIfInstalled
    
    :checkIfInstalled
    wmic qfe get hotfixid | find "KB3035583" | find "TTL" >nul
    IF NOT ERRORLEVEL 1 goto :uninstall
    IF     ERRORLEVEL 1 echo.
    echo The KB3035583 has not been installed.
    echo.
    goto :end
    
    :uninstall
    cd /d %windir%\system32\
    wusa /uninstall /KB:3035583 /quiet /norestart
    echo.
    echo The GWX update has been uninstalled.
    echo.
    goto :restart
    
    :restart
    echo.
    echo Your PC will restart soon!
    echo.
    timeout/t 5
    shutdown /r /t 15 /f
    
    :end
    How to hide updates read this:
    http://forums.mydigitallife.net/thr...script/page3?p=1140264&viewfull=1#post1140264

    To do: after reboot let the script continue to hide the GWX update and set it up to use latest cpu core