Board logo

标题: [系统相关] 批处理怎样实现输入进程名提取对应pid? [打印本页]

作者: 咒夜坠    时间: 2010-9-14 15:32     标题: 批处理怎样实现输入进程名提取对应pid?

  1. @echo off
  2. set /p s= (tasklist|find "%s%")>1.txt
  3. pause
复制代码

[ 本帖最后由 咒夜坠 于 2010-9-14 15:34 编辑 ]
作者: vsbat    时间: 2010-9-14 15:46

  1. @echo off
  2. set /p name=输入进程名:
  3. for /f "tokens=2" %%a in ('tasklist^|findstr %name%') do echo %%a
  4. pause
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2