User Tools

Site Tools


informatique:windows:batch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
informatique:windows:batch [2019/10/04 10:15] yahikoinformatique:windows:batch [2019/10/04 13:45] yahiko
Line 187: Line 187:
 FORFILES /P "C:\DOSSIER\Bidule" /S /M *.zip /D -15 /C "CMD /C del @path FORFILES /P "C:\DOSSIER\Bidule" /S /M *.zip /D -15 /C "CMD /C del @path
 </codedoc> </codedoc>
 +
 +==== Tuer un processus ====
 +<codedoc code:batch>
 +TASKKILL /F /IM processus.exe
 +</code>
 +
 +Du coup, on peut faire un truc du genre
 +<codedoc code:batch>
 +TASKLIST /FI "IMAGENAME eq machin.exe" 2>NUL | find /I /N "machin.exe">NUL
 +IF "%ERRORLEVEL%"=="0" (
 + TASKKILL /F /IM machin.exe > NUL
 +) ELSE (
 + ECHO Machin pas lancé n'est pas lancé.
 +)
 +</code>
informatique/windows/batch.txt · Last modified: 2023/09/14 08:46 by yahiko

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki