China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-07 16:12
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to use batch processing to detect whether a process exists? View 2,260 Replies 2
Original Poster Posted 2008-02-29 09:14 ·  中国 浙江 温州 电信
初级用户
★★
Credits 170
Posts 83
Joined 2007-11-30 16:44
18-year member
UID 104263
Gender Male
Status Offline
rt

It is to detect whether a specific known process exists in the current system operation.

Thank you!


tasklist /nh>d:\tddown~1\1.txt
find /i "QQ.exe" d:\tddown~1\1.txt
if errorlevel 1 (echo qq.exe does not exist>>d:\tddown~1\1.txt) else (echo qq.exe exists>>d:\tddown~1\1.txt)


After executing the find sentence, it always prompts "There should not be 1 at this time."

[ Last edited by zuimeng on 2008-2-29 at 09:59 AM ]
Floor 2 Posted 2008-02-29 11:40 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
tasklist /nh>d:\tddown~1\1.txt
find /i "QQ.exe" d:\tddown~1\1.txt
if ERRORLEVEL 1 (echo qq.exe does not exist>>d:\tddown~1\1.txt) else (echo qq.exe exists>>d:\tddown~1\1.txt)
Floor 3 Posted 2008-02-29 13:10 ·  中国 浙江 温州 电信
初级用户
★★
Credits 170
Posts 83
Joined 2007-11-30 16:44
18-year member
UID 104263
Gender Male
Status Offline
Thanks
Forum Jump: