Skip to content

Instantly share code, notes, and snippets.

@AlexLynd
Created July 16, 2021 20:30
Show Gist options
  • Save AlexLynd/714ef8dc7e2a6f97fab40fe5f6506594 to your computer and use it in GitHub Desktop.
Save AlexLynd/714ef8dc7e2a6f97fab40fe5f6506594 to your computer and use it in GitHub Desktop.
Windows program crasher batch file
@echo off
title Task launcher
color f0
set list=teams.exe, outlook.exe
:l
for %%i in (%list%) do (
tasklist /FI "IMAGENAME eq teams.exe" 2>NUL | find /I /N "teams.exe">NUL
if "%ERRORLEVEL%"=="0" echo Do not close this window attempting re-launch && timeout 10 && taskkill /F /IM %%i
echo Error Launching Task "Microsoft Teams"
timeout 2
cls
)
goto l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment