informatique:windows:batch
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
informatique:windows:batch [2019/10/04 13:45] – yahiko | informatique:windows:batch [2021/06/25 15:24] – [Afficher la date du jour format AAAAMMJJ] yahiko | ||
---|---|---|---|
Line 25: | Line 25: | ||
==== Afficher la date du jour format AAAAMMJJ ==== | ==== Afficher la date du jour format AAAAMMJJ ==== | ||
+ | Une autre solution pour formater la date au format JJMMAAAA (ou JJ-MM-AAAA) est disponible plus bas : [[informatique: | ||
+ | |||
Par exemple pour la mettre dans un nom de fichier. | Par exemple pour la mettre dans un nom de fichier. | ||
<codedoc code: | <codedoc code: | ||
Line 191: | Line 193: | ||
<codedoc code: | <codedoc code: | ||
TASKKILL /F /IM processus.exe | TASKKILL /F /IM processus.exe | ||
- | </code> | + | </codedoc> |
+ | |||
+ | Du coup, on peut faire un truc du genre : | ||
- | Du coup, on peut faire un truc du genre | ||
<codedoc code: | <codedoc code: | ||
TASKLIST /FI " | TASKLIST /FI " | ||
Line 201: | Line 204: | ||
ECHO Machin pas lancé n'est pas lancé. | ECHO Machin pas lancé n'est pas lancé. | ||
) | ) | ||
- | </ | + | </codedoc> |
+ | |||
+ | ==== Formater la date ==== | ||
+ | La variable d' | ||
+ | < | ||
+ | %date:/ | ||
+ | Retourne : JJ-MM-AAAA | ||
+ | |||
+ | %date:/ | ||
+ | Retourne : JJ_MM_AAAA | ||
+ | |||
+ | Par exemple | ||
+ | mkdir prout\%date:/ | ||
+ | Retourne un dossier prout\JJ-MM-AAAA | ||
+ | </ |
informatique/windows/batch.txt · Last modified: 2023/09/14 08:46 by yahiko