Friday, January 24, 2014

WMIC - How to get the command line of a process call

WMIC - How to get the command line of a process call

Situation:
I would like to know the following about the launch of MyProgram.exe on my remote server, MyTargetServer:
1.       Is it running?
2.       What was the command line call?

Call:

wmic /node:"WA-BLDSRV1-DEV" process get commandline | findstr MyProgram

Result:

C:\Windows\system32>wmic /node:"MyTargetServer" process get commandline | findstr TestSeriesManager
cmd  /c MyProgram.exe QA_BVT_Only_20140124.3


MyProgram.exe  QA_BVT_Only_20140124.3



C:\Windows\system32>


I now know that MyProgram.exe is running and that the parameter, QA_BVTOnly_20140124.3, was passed to it in the call.

No comments:

Post a Comment