![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-07 15:39 |
48,041 topics / 350,128 posts / today 3 new / 48,252 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] How to detect whether there is a specified process and perform corresponding operations on it? |
| Printable Version 1,561 / 7 |
| Floor1 jy02141405 | Posted 2008-02-24 19:42 |
| 初级用户 Posts 34 Credits 97 | |
|
─────────────────── 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 ] |
|
| Floor2 fastslz | Posted 2008-02-24 20:07 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
tasklist | find /i "QQ.EXE" &&taskkill /f /im QQ.EXE
|
|
| Floor3 HAT | Posted 2008-02-24 20:17 |
| 版主 Posts 5,017 Credits 9,023 | |
|
(tasklist /nh /fi "imagename eq QQ.exe"|findstr /i "QQ.exe")&&(taskkill /f /im "QQ.exe")
|
|
| Floor4 hy433124shc | Posted 2008-02-24 22:36 |
| 中级用户 Posts 75 Credits 201 | |
|
wmic process where name='QQ.exe' delete
|
|
| Floor5 lovelymorning | Posted 2008-02-24 22:46 |
| 初级用户 Posts 72 Credits 131 | |
|
@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 |
|
| Floor6 jy02141405 | Posted 2008-02-25 10:36 |
| 初级用户 Posts 34 Credits 97 | |
|
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.
|
|
| Floor7 HAT | Posted 2008-02-25 13:36 |
| 版主 Posts 5,017 Credits 9,023 | |
Originally posted by jy02141405 at 2008-2-25 10:36 AM: |
|
| Floor8 slore | Posted 2008-02-25 14:08 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
|
If it's not for cyclic monitoring, just use taskkill... Anyway, the ultimate goal is to have no QQ processes.
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |