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 04:32
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Desperately begging in the snow for a piece of code (timed execution code) View 824 Replies 10
Original Poster Posted 2007-12-28 18:28 ·  中国 浙江 温州 电信
初级用户
Credits 26
Posts 8
Joined 2007-12-27 21:42
18-year member
UID 106990
Gender Male
Status Offline
Please explain it in more detail
I'm a newbie

How can I end a specified process every 180 seconds
And if that process runs again, this batch file will still end it!

At first the moderator's reply really made me angry
Later I realized I had wrongly blamed the moderator
Searching the forum can find quite a few
There is a VBS script though
Just no bat one

I just want to learn
But nobody seems willing to help...
T_T

[ Last edited by papai on 2007-12-28 at 06:37 PM ]
Floor 2 Posted 2007-12-28 18:30 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
I've already seen "begging in the snow" many times, why don't you do a "sitting by the stove and begging" instead.
Floor 3 Posted 2007-12-28 18:38 ·  中国 黑龙江 哈尔滨 联通
初级用户
Credits 109
Posts 40
Joined 2007-12-22 15:41
18-year member
UID 106471
Gender Male
Status Offline
@echo off
:a
taskkill /f /im 你要kill的进程名称 >nul
ping 127.255.255.255 -n 1 -w 180000 >nul
goto a

、you can also use other delay statements
ping uses a bit of memory, though not very much

Use it together with a vbs script to run hidden
Floor 4 Posted 2007-12-28 18:46 ·  中国 浙江 温州 电信
初级用户
Credits 26
Posts 8
Joined 2007-12-27 21:42
18-year member
UID 106990
Gender Male
Status Offline
Mm
Learned a bit more again
I'm just a beginner newbie
I'm relying on the seniors' support
Floor 5 Posted 2007-12-28 21:03 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Floor 6 Posted 2007-12-29 03:30 ·  中国 北京 海淀区 北龙中网(北京)科技有限公司(BGP)
新手上路
Credits 10
Posts 5
Joined 2007-12-29 01:18
18-year member
UID 107085
Gender Male
Status Offline
I can't understand this at all
Floor 7 Posted 2007-12-29 10:05 ·  中国 浙江 温州 电信
初级用户
Credits 26
Posts 8
Joined 2007-12-27 21:42
18-year member
UID 106990
Gender Male
Status Offline
I can't understand the code in post #5

Is there a thread specifically introducing the parameters?
Floor 8 Posted 2007-12-29 12:07 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
Originally posted by papai at 2007-12-29 10:05:
I can't understand the code in post #5

Is there a thread specifically introducing the parameters?


schtasks /?

If you don't understand a command, just run "<CommandName> /?" to view the help.
Floor 9 Posted 2007-12-29 14:30 ·  中国 江西 南昌 电信
新手上路
Credits 10
Posts 4
Joined 2007-12-12 14:48
18-year member
UID 105428
Gender Male
Status Offline
;):coolC:\Documents and Settings\Administrator>schtasks /?
'schtasks' is not recognized as an internal or external command,
operable program or batch file.:cool:
Floor 10 Posted 2007-12-29 14:42 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Originally posted by nomyself at 2007-12-29 02:30 PM:
;):coolC:\Documents and Settings\Administrator>schtasks /?
'schtasks' is not recognized as an internal or external command,
operable program or batch file.:cool:

Which version of the operating system are you using?
Floor 11 Posted 2007-12-29 16:21 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Probably a stripped-down system
Forum Jump: