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