Script .bat pour supprimer les notifications de mise à jour Windows 10 sous Windows 7 / 8.1
By Admin on 2017-07-15 15:09:33
Nombre de vues : 12207
Depuis la sortie du dernier système d'exploitation de Microsoft, il faut bien se rendre à l'évidence, la firme tente par tous les moyens de convaincre le plus d'utilisateurs possible de passer sous Windows 10. La pratique de forcer la main avec différents popup et l’icône de GWX.exe qui persiste à s'afficher à côté de l'heure à vraiment dérangé beaucoup de monde. Mais pas à cause de cette mise en avant en elle-même, plutôt parce qu'il est compliqué de s'affranchir de ses différentes incitations à passer sous Windows 10 alors que l'on se trouve sur Windows 7 ou 8.1.
Il est ainsi compliqué de se débarrasser facilement de ces pop-up et notifications pour installer Windows 10, je vous en avais déjà parlé dans un précédent article et le seul moyen simple était de désinstaller à la main les différentes mises à jour. Un travail assez fastidieux. Mais des bons petits gars proposent depuis quelque temps maintenant différents scripts sur le web qui permet de supprimer automatiquement l'ensemble des mises à jour et logiciel concernant Windows 10.
C'est d’autant plus pratique que ces mises à jour ont parfois tendance à s'installer toutes seules au milieu des autres ... Il suffit donc d'enregistrer le script suivant au format .bat, de le lancer en administrateur et le tour est joué ! Au revoir les messages concernant Windows 10 sous Windows 7 ou Windows 8.1 ainsi que le programme GWX.exe. De plus si vous constatez que l’icône de gwx.exe revient, ou que vous avez de nouveaux pop up pour Windows 10, il vous suffit de relancer à nouveau le script ;) Très pratique donc, vous pouvez en abuser !
-
@echo off
-
-
:: before anything, let's specify what "yes" is interpreted in your language (for takeown)
-
for /F "tokens=3 delims= " %%G in ('reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage') do (
-
if [%%G] equ [040C] ( set yes=o ) else ( set yes=y )
-
)
-
:: First, we escalate privileges of the terminal
-
:checkPrivileges
-
NET FILE 1>NUL 2>NUL
-
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
-
:getPrivileges
-
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
-
echo.
-
echo Invoking UAC for Privilege Escalation
-
setlocal DisableDelayedExpansion
-
set "batchPath=%~0"
-
setlocal EnableDelayedExpansion
-
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
-
echo args = "ELEV " >> "%temp%\OEgetPrivileges.vbs"
-
echo For Each strArg in WScript.Arguments >> "%temp%\OEgetPrivileges.vbs"
-
echo args = args ^& strArg ^& " " >> "%temp%\OEgetPrivileges.vbs"
-
echo Next >> "%temp%\OEgetPrivileges.vbs"
-
echo UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
-
"%SystemRoot%\System32\WScript.exe" "%temp%\OEgetPrivileges.vbs" %*
-
exit /B
-
:gotPrivileges
-
if '%1'=='ELEV' shift /1
-
setlocal & pushd .
-
cd /d %~dp0
-
:: privilege escalation OK
-
color 0a
-
echo GWX / GWX Schedule / Windows spy updates search & destroy
-
echo ----------------------------------------------
-
timeout 3
-
color 0e
-
:: now time to remove nasty update
-
echo Uninstalling KB2952664 (Get Windows 10 assistant)
-
wusa /uninstall /kb:2952664 /quiet /norestart
-
echo Uninstalling KB2976978 (telemetry for Win8/8.1)
-
wusa /uninstall /kb:2976978 /quiet /norestart
-
echo Uninstalling KB2977759 (telemetry for Win7)
-
wusa /uninstall /kb:2977759 /quiet /norestart
-
echo Uninstalling KB2990214 (Get Windows 10 for Win7)
-
wusa /uninstall /kb:2990214 /quiet /norestart
-
echo Uninstalling KB3021917 (installs telemetry for CEIP)
-
wusa /uninstall /kb:3021917 /quiet /norestart
-
echo Uninstalling KB3022345 (telemetry)
-
wusa /uninstall /kb:3022345 /quiet /norestart
-
echo Uninstalling KB3035583 (GWX Notification)
-
wusa /uninstall /kb:3035583 /quiet /norestart
-
echo Uninstalling KB3044374 (Get Windows 10 for Win8.1)
-
wusa /uninstall /kb:3044374 /quiet /norestart
-
echo Uninstalling KB3068708 (telemetry)
-
wusa /uninstall /kb:3068708 /quiet /norestart
-
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
-
wusa /uninstall /kb:3075249 /quiet /norestart
-
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
-
wusa /uninstall /kb:3080149 /quiet /norestart
-
echo Uninstalling KB3112336 (New Win8.1-^>10 upgrade scenario)
-
wusa /uninstall /kb:3112336 /quiet /norestart
-
echo Uninstalling KB3112343 (New Win7-^>10 upgrade scenario)
-
wusa /uninstall /kb:3112343 /quiet /norestart
-
echo Uninstalling KB3123862 (Updated capabilities to upgrade Windows 8.1 and Windows 7)
-
wusa /uninstall /kb:3123862 /quiet /norestart
-
timeout 30
-
:: then taking ownership of remnant folders
-
echo Take control for all folders GWX
-
timeout 3
-
:: let's check if GWX was already removed
-
set error=0
-
if not exist %windir%\System32\GWX set error=%error%+1
-
if not exist %windir%\SysWOW64\GWX set error=%error%+1
-
if %error%==2 goto error1
-
takeown /F %windir%\System32\GWX /A /R /D %yes%
-
takeown /F %windir%\SysWOW64\GWX /A /R /D %yes%
-
takeown /F %windir%\System32\Tasks\Microsoft\Windows\Setup /A /R /D %yes%
-
echo Change rights for all folders GWX
-
timeout 3
-
icacls %windir%\System32\GWX /grant "%username%":(F) /T /C
-
icacls %windir%\SysWOW64\GWX /grant "%username%":(F) /T /C
-
icacls %windir%\System32\Tasks\Microsoft\Windows\Setup /grant "%username%":(F) /T /C
-
:: ok, now time to kill executable and remove this shit out of our computer
-
echo Delete all GWX files and folders
-
timeout 3
-
echo Before kill GWX.exe if necessary
-
taskkill /f /t /im GWX.exe
-
timeout 3
-
del /F /S /Q /A %windir%\System32\GWX\*
-
rd /S /Q %windir%\System32\GWX
-
:: some error handling (see eof)
-
if exist %windir%\System32\GWX goto error2
-
del /F /S /Q /A %windir%\SysWOW64\GWX\*
-
rd /S /Q %windir%\SysWOW64\GWX
-
if exist %windir%\SysWOW64\GWX goto error2
-
:: removing related sheduled tasks
-
del /F /S /Q /A %windir%\System32\Tasks\Microsoft\Windows\Setup\*
-
rd /S /Q %windir%\System32\Tasks\Microsoft\Windows\Setup\gwx
-
rd /S /Q %windir%\System32\Tasks\Microsoft\Windows\Setup\GWXTriggers
-
:: setting policy to disable GWX
-
reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\Gwx
-
reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\Gwx /v DisableGwx /t REG_DWORD /d 1
-
:: prevent further upgrade
-
::reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade
-
::reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /v AllowOSUpgrade /t REG_DWORD /v 0
-
::reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /v ReservationsAllowed /t REG_DWORD /v 0
-
color 0a
-
echo Cleaned. Don't forget to hide these updates in Windows update to prevent reappearance.
-
echo Have a nice day.
-
pause
-
exit
-
:error1
-
color 0c
-
echo GWX does not seems to be installed, exiting.
-
pause
-
exit
-
:error2
-
color 0c
-
echo Cannot remove GWX folder, are you really running this as admin? exiting.
-
pause
Articles de la même catégorie :