Windows Management Instrumentationは、ファイルパスまたはプロセスの完全なコマンドラインのいずれかを表示することを目的としています。
wmic process where "name='mysqld.exe'" get ProcessID, ExecutablePath
or
wmic process where "name='mysqld.exe'" get ProcessID, ExecutablePath /FORMAT:LIST
このCommandLineオプションは、ターゲットデータパスやtcpポートなどの開始スイッチを表示します
explorer.exeの出力例を次に示します。
C:\Users\Richie>wmic process where "name='explorer.exe'" get ProcessID, ExecutablePath, CommandLine /FORMAT:LIST
CommandLine=C:\Windows\Explorer.EXE
ExecutablePath=C:\Windows\Explorer.EXE
ProcessId=3268
CommandLine=C:\Windows\explorer.exe /factory,{ceff45ee-c862-41de-aee2-a022c81eda92} -Embedding
ExecutablePath=C:\Windows\explorer.exe
ProcessId=4236
C:\Users\Richie>wmic process where "name='explorer.exe'" get ProcessID, ExecutablePath, CommandLine
CommandLine ExecutablePath ProcessId
C:\Windows\Explorer.EXE C:\Windows\Explorer.EXE 3268
C:\Windows\explorer.exe /factory,{ceff45ee-c862-41de-aee2-a022c81eda92} -Embedding C:\Windows\explorer.exe 4236