Auto fermeture d'une application
Pour une auto fermeture d'un application après un délai SI elle n'est pas fermée avant ce délai, voici un example de code batch
example avec notepad.exe
@echo off
setlocal enableDelayedExpansion
set waitDelay=10
set i=1
:loop
if !i! neq %waitDelay% (
echo %i%
set /a i=%i%+1
timeout /T 1>NUL
REM if not exist mshta.exe goto _next
tasklist /fi "imagename eq notepad.exe" |find "notepad">nul
if errorlevel 1 goto :_next
goto :loop
)
:_next
tasklist /fi "imagename eq notepad.exe" |find "notepad">nul
if errorlevel 0 taskkill /F /IM notepad.exe>nul 2>&1
Dernière modification : le 2023/09/27
