1.查看所有進程的
wmic process get caption,commandline /value
2.列舉當前的進程、進程路徑、命令行、進程ID、父進程ID、線程數,內存使用
wmic process get name,executablepath,commandline,processid,parentprocessid,threadcount,workingsetsize/value
3. 根據執行的文件,如python.exe 的所屬的進程
wmic process where caption="python.exe" get processid,caption,commandline /value
4.根據cmd命令查詢進程,如查詢命令為python detection.py的進程
wmic process where CommandLine="python detection.py" get processid /value
輸出
ProcessId=17956
5.殺死進程
taskkill /F /PID 17956
輸出
成功: 已終止 PID 為 17956 的進程。