Skip to content

Instantly share code, notes, and snippets.

@hrz6976
Created July 1, 2024 19:53
Show Gist options
  • Save hrz6976/6b772d8c887ba7fa7796adc18456665c to your computer and use it in GitHub Desktop.
Save hrz6976/6b772d8c887ba7fa7796adc18456665c to your computer and use it in GitHub Desktop.
Try to avoid Windows Mail from constantly switching to the shi!tty new Outlook
@echo off
setlocal
REM Check if Windows Mail is running
tasklist /FI "IMAGENAME eq HxOutlook.exe" 2>NUL | find /I /N "HxOutlook.exe">NUL
if "%ERRORLEVEL%"=="0" (
echo HxOutlook.exe is running. Closing it...
taskkill /F /IM HxOutlook.exe
) else (
echo HxOutlook.exe is not running.
)
REM Change directory to the specified path
cd /d "%LOCALAPPDATA%\Packages\microsoft.windowscommunicationsapps_8wekyb3d8bbwe\LocalState"
REM Check if the Migration folder exists
if exist Migration (
echo Migration folder exists. Deleting it...
rd /s /q Migration
)
REM Create an empty Migration file
echo.>Migration
echo Script completed.
endlocal
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment