Bonjour,
j'ai un test.txt qui contient le résultat d'un "sc queryex" exemple :
j'aimerai ne récupérer qu'une série de ligne genre :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 SERVICE_NAME: WudfSvc DISPLAY_NAME: Windows Driver Foundation - User-mode Driver Framework TYPE : 20 WIN32_SHARE_PROCESS STATE : 4 RUNNING (NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 PID : 1060 FLAGS : SERVICE_NAME: WZCSVC DISPLAY_NAME: Configuration automatique sans fil TYPE : 20 WIN32_SHARE_PROCESS STATE : 4 RUNNING (STOPPABLE,NOT_PAUSABLE,ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 PID : 984 FLAGS :
je sais faire un :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 DISPLAY_NAME: Windows Driver Foundation - User-mode Driver Framework STATE : 4 DISPLAY_NAME: Configuration automatique sans fil STATE : 4 RUNNING
type "txt.txt" | find /i "DISPLAY_NAME" >>result.txt
type "txt.txt" | find /i "STATE" >>result.txt
mais cela me sors alors les choses dans le désordre genre :
qq saurait faire cela ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 DISPLAY_NAME: Windows Driver Foundation - User-mode Driver Framework DISPLAY_NAME: Configuration automatique sans fil STATE : 4 RUNNING STATE : 4 RUNNING
merci d'avance ^^
Partager