我们常常需要知道运行的进程在哪个目录下。使用wmic非常方便,能够知道进程的详细信息。 例如:任务管理器中显示的进程名为c.exe. 查找路径方法是:打开cmd.exe,输入wmic ,然后输入process where(Description="c.exe") wmic 作用总结: 一、查询数据 1 使用get查询 wmic process get name,executablepath
2 无条件查询 wmic process list brief
wmic process list full
3加where条件查询 wmic process where name="qq.exe" get processid,executablepath,name
会显示所有的同名进程,注意where条件在前面,要获取的属性在后面。 二、创建进程 wmic process call create "c:\windows\system32\cmd.exe"
三、结束进程 wmic process where name="qq.exe" call terminate wmic process where name="qq.exe" delete
转载自:http://blog.csdn.net/cfanzp/article/details/8825130 |
|