From 3c3a99c98f7750aa0a9a7e8546a8b782f83cada4 Mon Sep 17 00:00:00 2001 From: breadcat Date: Sun, 5 Jul 2020 19:04:09 +0100 Subject: Suppress error on not-finding process --- win10-prep.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win10-prep.bat b/win10-prep.bat index 22dd235..4f78cd6 100644 --- a/win10-prep.bat +++ b/win10-prep.bat @@ -229,7 +229,8 @@ exit /b %errorlevel% :remove_software rem remove onedrive, remove explorer tree item -taskkill /f /im onedrive.exe +tasklist /FI "IMAGENAME eq onedrive.exe" 2>NUL | find /I /N "onedrive.exe">NUL +if "%ERRORLEVEL%"=="0" echo taskkill /f /im onedrive.exe if exist "%windir%\system32\onedrivesetup.exe" "%windir%\system32\onedrivesetup.exe" /uninstall if exist "%windir%\syswow64\onedrivesetup.exe" "%windir%\syswow64\onedrivesetup.exe" /uninstall reg delete "HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f -- cgit v1.2.3