|
jy02141405
初级用户
 
积分 97
发帖 34
注册 2007-11-16
状态 离线
|
『楼 主』:
[求助]如何检测是否有指定进程并对其进行相应的操作?
使用 LLM 解释/回答一下
─────────────────── 版务记录 ────────────────────
执行:bjsh
标题:请教这个批处理怎么写哦??
说明:因标题表述过于模糊,不便于论坛的搜索和管理,请在三日内修改标题,否则扣除2点积分
参考:http://www.cn-dos.net/forum/viewthread.php?tid=7326&fpage=1
http://www.cn-dos.net/forum/viewthread.php?tid=1415
─────────────────── 版务记录 ────────────────────
检查电脑里有没QQ。EXE进程,有则自动结束
我是这样写的,不过不行,还请高手指点
@echo off
tasklist > a.txt
type a.txt | find "QQ.EXE" && taskkill /im "QQ.EXE"
pause
exit
Last edited by lxmxn on 2008-2-26 at 01:27 AM ]
─────────────────── Moderation Record ────────────────────
Performed by: bjsh
Title: Please teach me how to write this batch script??
Description: The title is too vague, which is not convenient for forum search and management. Please modify the title within three days, otherwise 2 points of points will be deducted
Reference: http://www.cn-dos.net/forum/viewthread.php?tid=7326&fpage=1
http://www.cn-dos.net/forum/viewthread.php?tid=1415
─────────────────── Moderation Record ────────────────────
Check if there is a QQ.EXE process in the computer. If there is, automatically end it
I wrote it like this, but it doesn't work. Please ask experts for guidance
@echo off
tasklist > a.txt
type a.txt | find "QQ.EXE" && taskkill /im "QQ.EXE"
pause
exit
Last edited by lxmxn on 2008-2-26 at 01:27 AM ]
此帖被 -2 点积分 点击查看详情 评分人:【 lxmxn 】 | 分数: -2 | 时间:2008-2-26 01:26 |
|
|
|
2008-2-24 19:42 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
tasklist | find /i "QQ.EXE" &&taskkill /f /im QQ.EXE
tasklist | find /i "QQ.EXE" &&taskkill /f /im QQ.EXE
|

第一高手 第二高手
我的小站
 |
|
2008-2-24 20:07 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
(tasklist /nh /fi "imagename eq QQ.exe"|findstr /i "QQ.exe")&&(taskkill /f /im "QQ.exe")
(tasklist /nh /fi "imagename eq QQ.exe"|findstr /i "QQ.exe")&&(taskkill /f /im "QQ.exe")
|
|
2008-2-24 20:17 |
|
|
hy433124shc
中级用户
  
积分 201
发帖 75
注册 2007-2-24
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
wmic process where name='QQ.exe' delete
wmic process where name='QQ.exe' delete
|
|
2008-2-24 22:36 |
|
|
lovelymorning
初级用户
 
积分 131
发帖 72
注册 2008-2-24
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
@echo off
tasklist|find /i "qq.exe" ||exit
taskkill /im qq.exe /f
先用tasklist 输入进程列表给find ,让find找出qq.exe进程,如果找到,那执行下面的结束操作,找不到就退出bat
@echo off
tasklist|find /i "qq.exe" ||exit
taskkill /im qq.exe /f
First use tasklist to input the process list to find, let find find the qq.exe process. If found, then perform the following end operation, if not found, exit the bat
|
|
2008-2-24 22:46 |
|
|
jy02141405
初级用户
 
积分 97
发帖 34
注册 2007-11-16
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
谢谢,可是我为什么把进程列表放在A文档里面然后再用FIND查找没用呢
难道是没/I 忽略大小写 的原因 ,我想知道下,还请指导
Thanks, but why is it not working when I put the process list in document A and then use FIND to search? Could it be because of the lack of the /I option to ignore case? I want to know, please guide me.
|
|
2008-2-25 10:36 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Originally posted by jy02141405 at 2008-2-25 10:36 AM:
谢谢,可是我为什么把进程列表放在A文档里面然后再用FIND查找没用呢
难道是没/I 忽略大小写 的原因 ,我想知道下,还请指导
@echo off
tasklist>C:\a.txt
find "QQ.exe" C:\a.txt&&taskkill /f /im "QQ.exe"
Originally posted by jy02141405 at 2008-2-25 10:36 AM:
Thanks, but why does it not work when I put the process list in document A and then use FIND to search?
Could it be because of the lack of the /I option to ignore case? I want to know, please guide me
@echo off
tasklist>C:\a.txt
find "QQ.exe" C:\a.txt&&taskkill /f /im "QQ.exe"
|
|
2008-2-25 13:36 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
如果不是要循环监控的话,直接taskkill。。。反正最终目的是不要有QQ进程。
If it's not for cyclic monitoring, just use taskkill... Anyway, the ultimate goal is to have no QQ processes.
|
|
2008-2-25 14:08 |
|