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 revision
Previous revision
Next revisionBoth sides next revision
informatique:windows:batch [2019/10/04 10:15] yahikoinformatique:windows:batch [2019/10/04 13:45] yahiko
Line 186: Line 186:
 <codedoc code:batch> <codedoc code:batch>
 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>
 +
 +==== Tuer un processus ====
 +<codedoc code:batch>
 +TASKKILL /F /IM processus.exe
 +</codedoc>
 +
 +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é.
 +)
 </codedoc> </codedoc>
informatique/windows/batch.txt · Last modified: 2023/09/14 08:46 by yahiko

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki