1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
| @echo off
:: On execute les commandes en administateur
:-------------------------------------
REM --> Verification des permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> Erreur vous ne possedez pas les droits admin
if '%errorlevel%' NEQ '0' (
echo Verification des privileges administrateur
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"="
echo UAC.ShellExecute "%~s0", "%params%", "", "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"
:--------------------------------------
mode con: cols=80 lines=8
title Dsinstallation-Rinstallation de OneDrive / 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 OneDrive?',0,'Supprimer/Rinstaller OneDrive',35));close();"`
) do (
if "%%f"=="6" (
if not exist C:\Users\*****\AppData\Local\Microsoft\OneDrive (
rundll32 user32.dll,MessageBeep
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'Les fichiers de OneDrive sembe dj
dsinstalls! ', 160, '[Erreur] Dsinstallation de OneDrive! [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 OneDrive.exe /T
if errorlevel 1 (pause)
rem timeout /t 10
rem exit)
rem taskkill /F /IM RemindersServer.exe /T
move C:\Users\*****\AppData\Local\Microsoft\OneDrive C:\Users\*****\AppData\Local\Microsoft\OneDrive_old
set /a count+=1
cls
echo Nombre de tentatives de suppression du logiciel OneDrive : %count%/%maxT%
if not exist C:\Windows\SystemApps\Microsoft.Windows.OneDrive_cw5n1h2txyewy (
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'OneDrive supprim avec succs aprs %count% tentative(s)!', 10, 'Dsinstallation de OneDrive!', 64 );close()"
goto :3
)
if %count% GEQ %maxT% (
rundll32 user32.dll,MessageBeep
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'La dsinstallation de OneDrive a choue aprs %count% tentatives!', 160, '[Erreur] Dsinstallation de OneDrive! [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 rinstaller OneDrive? ',160,'Supprimer/Rinstaller OneDrive',36));close();"`
) do (
if "%%f"=="6" (
if exist C:\Users\******\AppData\Local\Microsoft\OneDrive (
rundll32 user32.dll,MessageBeep
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'Les fichiers de OneDrive sembe dj
installs! ', 160, '[Erreur] Dsinstallation de OneDrive! [Erreur]', 0 );close()"
goto :3
)
rem YES
) else (
goto :3
)
)
if exist C:\Users\****\AppData\Local\Microsoft\OneDrive (
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'OneDrive semble dj
install! ', 160, 'Installation de OneDrive', 64 );close()"
goto :3
)
move C:\Users\*****\AppData\Local\Microsoft\OneDrive_old C:\Users\*****\AppData\Local\Microsoft\OneDrive
if errorlevel 1 (
rundll32 user32.dll,MessageBeep
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'L\'installation de OneDrive a choue! ', 160, '[Erreur] Installation de OneDrive! [Erreur]', 0 );close()"
exit
)
if exist C:\Users\*****\AppData\Local\Microsoft\OneDrive (
rundll32 user32.dll,MessageBeep
mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'L\'installation de OneDrive est termine! ', 160, 'Installation de OneDrive!', 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 |
Partager