![]() |
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-09-23 15:27 |
47,812 topics / 349,917 posts / today 0 new / 48,273 members |
| DOS批处理 & 脚本技术(批处理室) » Closed: Batch script for checking and closing processes |
| Printable Version 1,835 / 4 |
| Floor1 zreo | Posted 2005-11-20 16:51 |
| 初级用户 Posts 14 Credits 51 | |
|
I want to write a line in a batch script to check if there is a specified program in the process. If there is, use GOTO to close another specified program. If not, use GOTO to execute other commands.
Thank you, brother. I know how to use TASKLIST to check, but I want to compile a program. For example, if Photoshop.exe is detected in the process, in the batch script, use the GOTO command to close another specified program TheWorld.exe. If Photoshop.exe is not detected, use GOTO to execute other program commands. [ Last edited by willsort on 2005-11-25 at 19:34 ] |
|
| Floor2 220110 | Posted 2005-11-20 17:15 |
| 荣誉版主 Posts 313 Credits 718 | |
|
You can use tasklist to view WIN processes.
|
|
| Floor3 无奈何 | Posted 2005-11-20 23:14 |
| 荣誉版主 Posts 356 Credits 1,338 | |
|
Try this!
|
|
| Floor4 无奈何 | Posted 2005-11-20 23:25 |
| 荣誉版主 Posts 356 Credits 1,338 | |
|
In my place, when intercepting the output of tasklist with a pipe, sometimes the process is incomplete. If you also encounter such a problem, switch to the following code.
|
|
| Floor5 zreo | Posted 2005-11-20 23:37 |
| 初级用户 Posts 14 Credits 51 | |
|
Thanks, Brother Wunaike. I'm really grateful. I looked at it for a while. Finally understood this command. Really appreciate you.
[ Last edited by zreo on 2005-11-20 at 23:44 ] |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |