执行:- wmic process where name='w3wp.exe' get ProcessId,WorkingSetSize,Caption,CommandLine
复制代码 得到:- ProcessId WorkingSetSize
- Caption CommandLine ProcessId WorkingSetSize
- w3wp.exe c:\windows\system32\inetsrv\w3wp.exe -ap "5050" -v "v4.0" -l "webengine4.dll" -a \\.\pipe\iisipmdc50f55a-6336-4f59-8b39-c0d76a89131b -h "C:\inetpub\temp\apppools\5050\5050.config" -w "" -m 0 -t 20 -ta 0 16644 114728960
- w3wp.exe c:\windows\system32\inetsrv\w3wp.exe -ap "5051" -v "v4.0" -l "webengine4.dll" -a \\.\pipe\iisipme8e08e32-0c70-47af-8695-fc902c833a22 -h "C:\inetpub\temp\apppools\5051\5051.config" -w "" -m 0 -t 20 -ta 0 13944 141348864
复制代码 可以对得到的结果进行替换吗?得到类似如下的结果:[code]
Caption UserName ProcessId WorkingSetSize
w3wp.exe 5050 16644 114728960
w3wp.exe 5051 13944 141348864
即:列名变化:CommandLine--->UserName,
列UserName的值取原“c:\windows\system32\inetsrv\w3wp.exe -ap”后第一个引号里面的内容,如原来是c:\windows\system32\inetsrv\w3wp.exe -ap "5050" .....只取5050 |