Skip to content

Commit

Permalink
fix(onedrive): don't strip if files exist
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Nov 29, 2023
1 parent 54aa770 commit 2f4549b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/playbook/Executables/ONED.cmd
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
@echo off

taskkill /f /im OneDrive*.exe > nul 2>&1
for /f "usebackq delims=" %%a in (`dir /b /a:d "%SystemDrive%\Users"`) do (
if exist "%SystemDrive%\Users\%%a\OneDrive" (
dir "%SystemDrive%\Users\%%a\OneDrive" /b | findstr "." > nul 2>&1 && (
echo Not stripping OneDrive as OneDrive files exist, exiting...
exit 6000
)
)
)

taskkill /f /im OneDrive.exe > nul 2>&1
for %%a in (
"%windir%\System32\OneDriveSetup.exe"
"%windir%\SysWOW64\OneDriveSetup.exe"
) do (
if exist "%%a" (
"%%a" /uninstall > nul 2>nul
"%%a" /uninstall > nul 2>&1
)
)

Expand Down

0 comments on commit 2f4549b

Please sign in to comment.