Skip to content

Instantly share code, notes, and snippets.

@LeNarvalo
Created September 10, 2016 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeNarvalo/3532e57b63a70c174824780a9b3dd012 to your computer and use it in GitHub Desktop.
Save LeNarvalo/3532e57b63a70c174824780a9b3dd012 to your computer and use it in GitHub Desktop.
@echo off
mode con: cols=80 lines=8
title D‚sinstallation-R‚installation de Cortana / Version 1.0.0 / LeNarvalo
color 0A
set /a maxT = 100
:0
for /f "usebackq" %%f in (
`mshta "javascript:new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Write(new ActiveXObject('WScript.Shell').PopUp('Voulez vous supprimer Cortana?\nVous ne pourrez plus utiliser la fonction Rechercher sur Windows en bas … gauche de la barre de tache!',0,'Supprimer/R‚installer Cortana',35));close();"`
) do (
if "%%f"=="6" (
if not exist C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy (
rundll32 user32.dll,MessageBeep
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'Les fichiers de Cortana sembe d‚j… d‚sinstall‚s! ', 160, '[Erreur] D‚sinstallation de Cortana! [Erreur]', 0 );close()"
goto :0
)
rem YES
goto :1
) else if "%%f"=="7" (
rem NO
goto :2
) else (
goto :3
)
)
set /a count = 0
:1
taskkill /F /IM SearchUI.exe /T
taskkill /F /IM RemindersServer.exe /T
move C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy C:\Windows\SystemApps\oldMicrosoft.Windows.Cortana_cw5n1h2txyewy
set /a count+=1
cls
echo Nombre de tentatives de suppression du logiciel Cortana : %count%/%maxT%
if not exist C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy (
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'Cortana supprim‚ avec succŠs aprŠs %count% tentative(s)!', 10, 'D‚sinstallation de Cortana!', 64 );close()"
goto :3
)
if %count% GEQ %maxT% (
rundll32 user32.dll,MessageBeep
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'La d‚sinstallation de Cortana a ‚chou‚e aprŠs %count% tentatives!', 160, '[Erreur] D‚sinstallation de Cortana! [Erreur]', 0 );close()"
goto :3
)
goto :1
:2
for /f "usebackq" %%f in (
`mshta "javascript:new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Write(new ActiveXObject('WScript.Shell').PopUp('Voulez vous r‚installer Cortana? ',160,'Supprimer/R‚installer Cortana',36));close();"`
) do (
if "%%f"=="6" (
if exist C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy (
rundll32 user32.dll,MessageBeep
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'Les fichiers de Cortana sembe d‚j… install‚s! ', 160, '[Erreur] D‚sinstallation de Cortana! [Erreur]', 0 );close()"
goto :3
)
rem YES
) else (
goto :3
)
)
if exist C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy (
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'Cortana semble d‚j… install‚! ', 160, 'Installation de Cortana', 64 );close()"
goto :3
)
move C:\Windows\SystemApps\oldMicrosoft.Windows.Cortana_cw5n1h2txyewy C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy
if errorlevel 1 (
rundll32 user32.dll,MessageBeep
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'L\'installation de Cortana a ‚chou‚e! ', 160, '[Erreur] Installation de Cortana! [Erreur]', 0 );close()"
exit
)
if exist C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy (
rundll32 user32.dll,MessageBeep
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'L\'installation de Cortana est termin‚e! ', 160, 'Installation de Cortana!', 0 );close()"
)
:3
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'Merci d\'avoir utiliser ce logiciel. Pour tout renseignement veuillez contacter : bzh.lenarvalo@live.fr', 160, 'Merci! =)', 0 );close()"
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment