matschbirne
Goto Top

WMIC Abfrage funktioniert in CMD aber nicht in Batch

Hallo und Guten Abend zusammen,

ich komme gerade nicht weiter und obwohl ich schon das halbe Netz abgegrast habe, finde ich keine Antwort (wahrscheinlich nur weil ich gerade betriebsblind bin):

Ich will feststellen welche Prozesse innerhalb eines Pfades ablaufen, das Ganze mit WMIC in einer Batch. Im CMD funktioniert es auch, aber sobald ich es als Batch speichere nicht (getestet unter WinXP32bit/Win764bit):

wmic process where "commandLine like '%net%'" get name  
->liefert mir alle Prozesse in denen "net" im Pfad vorkommt.
als Batch ausgeführt aber nur "Keine Instanzen verfügbar"

Variationen davon verhalten sich identisch, also z.B.:
wmic path win32_process Where "commandLine like '%net%'" get name  
oder
wmic process where "executablepath like '%net%'" get name  

CMD geht, Batch nicht... vbs geht auch, aber warum nicht in Batch?

Bin dankbar für jeden Rat...

Viele Grüße,
matschbirne

Content-Key: 194327

Url: https://administrator.de/contentid/194327

Printed on: April 23, 2024 at 12:04 o'clock

Member: DerWoWusste
DerWoWusste Nov 15, 2012 at 19:20:36 (UTC)
Goto Top
Hi.

Editier mal auf %%net%%
...ist so in Batch.
Member: matschbirne
matschbirne Nov 15, 2012 at 19:31:57 (UTC)
Goto Top
Vielen Dank, das war's... face-smile