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
未经博主允许,禁止直接转载本博客任何内容(可以在文章中添加链接,禁止原文照搬),如需直接原文转载对应文章,请在该文章中留言联系博主,谢谢!!