2
0
tcse-deploy/Login/Uninstall-OneDrive.bat
2024-12-09 21:16:35 -06:00

23 lines
813 B
Batchfile
Executable File

@echo off
:: Check if OneDrive is installed
echo Checking if Microsoft OneDrive is installed...
:: Check for OneDrive installation by looking for its executable
if exist "%LOCALAPPDATA%\Microsoft\OneDrive\OneDrive.exe" (
echo OneDrive is installed. Proceeding with uninstallation...
echo Uninstalling OneDrive... >> "%LOGFILE%"
if exist "%SystemRoot%\System32\OneDriveSetup.exe" (
"%SystemRoot%\System32\OneDriveSetup.exe" /uninstall
if !errorlevel! neq 0 (
echo ERROR: Failed to uninstall OneDrive
) else (
echo Successfully uninstalled OneDrive
)
) else (
echo WARNING: OneDriveSetup.exe not found
)
) else (
echo WARNING: Microsoft OneDrive is not installed. Skipping uninstallation.
)
endlocal