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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM