使用wmic获取运行中进程的路径

来源:互联网 发布:软件实施过程 编辑:程序博客网 时间:2024/05/29 17:10

         我们常常需要知道运行的进程在哪个目录下。使用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://hi.baidu.com/escortmnm/item/87d3f8625386b72369105bd9

原创粉丝点击