dos 命令查找进程pid pid_find.bat

来源:互联网 发布:电子海洛因 知乎 编辑:程序博客网 时间:2024/06/16 19:01

//zz//############################################

pid-find.bat

zz@2014-12-22 00:23:30

没什么特别的,linux下玩了下脚本

想起到dos上来玩玩bat脚本, for /f 和 |find /i 的使用


@title dos_find_pid

@color 0a
@echo just an sample
@echo off
for /f "tokens=2" %%a in ('tasklist ^|find /i "computerz_cn.exe"') do set qqpid=%%a
echo PID=%qqpid%

pause&exit/b

0 0