bat wmic python 获取进程的所在路径

bat wmic python 获取进程的所在路径

doc:

 

wmic process where name="process-name" get executablepath

wmic process where "name like '%chrome%'" get processid,commandline /format:list

 

 

python:

import subprocess
cmd = 'wmic process where "name=\'notepad.exe\'" get ExecutablePath'
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
print proc.stdout.read()

 

参考链接:https://superuser.com/questions/1003921/how-to-show-full-command-line-of-all-processes-in-windows

获取其它属性:

  • Caption
  • CommandLine
  • CreationClassName
  • CreationDate
  • CSCreationClassName
  • CSName
  • Description
  • ExecutablePath
  • ExecutionState
  • Handle
  • HandleCount
  • InstallDate
  • KernelModeTime
  • MaximumWorkingSetSize
  • MinimumWorkingSetSize
  • Name
  • OSCreationClassName
  • OSName
  • OtherOperationCount
  • OtherTransferCount
  • PageFaults
  • PageFileUsage
  • ParentProcessId
  • PeakPageFileUsage
  • PeakVirtualSize
  • PeakWorkingSetSize
  • Priority
  • PrivatePageCount
  • ProcessId
  • QuotaNonPagedPoolUsage
  • QuotaPagedPoolUsage
  • QuotaPeakNonPagedPoolUsage
  • QuotaPeakPagedPoolUsage
  • ReadOperationCount
  • ReadTransferCount
  • SessionId
  • Status
  • TerminationDate
  • ThreadCount
  • UserModeTime
  • VirtualSize
  • WindowsVersion
  • WorkingSetSize
  • WriteOperationCount
  • WriteTransferCount
posted @ 2019-06-13 15:35  ibingshan  阅读(1886)  评论(0编辑  收藏  举报