中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-06-28 01:21
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » 各位大虾快来帮帮我好吗?????? 查看 4,946 回复 2
楼 主 各位大虾快来帮帮我好吗?????? 发表于 2004-07-10 00:00 ·  中国 河北 廊坊 联通
初级用户
积分 103
发帖 1
注册 2004-07-10 00:00
21年会员
UID 28118
性别 男
状态 离线
我是个菜鸟,有个问题想请教各位,我想在dos里,在指定的时间段内,重起机器是启动一些程序,请各位教教我好吗
2 发表于 2004-07-11 00:00 ·  中国 上海 鹏博士宽带
高级用户
★★
zhri
积分 665
发帖 153
注册 2004-02-23 00:00
22年会员
UID 18241
性别 男
状态 离线
用程序写吧。

DOS不是一种汇编。

DOS也不是什么语言。

只是,因为当时存储器很贵(内存、外存),不可能用Windows。

DOS命令你可以把他想象成,一大段程序,然后去掉了花哨的外客和说明文件,直接的中间的核心代码。(除了干完某件事外,什么都没有)

批处理的功能很弱的。他不可能驻留内存。DOS运行程序是独享的,所以,这样才会让人家想出驻留程序的办法.......

。。。。。。
3 发表于 2004-07-11 00:00 ·  中国 河北 保定 联通
铂金会员
★★★★
网络独行侠
积分 6,962
发帖 2,753
注册 2003-04-16 00:00
23年会员
UID 1565
性别 男
来自 河北保定
状态 离线
To 楼主:

如果你能写好你的帖子的标题,或许你的问题能够更快的得到解决,详情请看我签名中的帖子。

关于你的问题,也不是不可能实现,不过可能跟你的具体应用环境(例如所使用的DOS版本有关系),基本的思路:
在dos的autoexec.bat中加入判断当前系统时间的有关命令,如果该时间在你所要求的时间段内则执行你想执行的命令。视你的需求,有可能需要第三方的工具,我推荐你看一下Horst提供的有关批处理中进行时间处理的某些小工具。例如TimeNow。

TimeNow的用法:
------------------------------------------------------------------------
TimeNow Time check Ver 1.0 (c) 1997 Horst Schaeffer
------------------------------------------------------------------------

TimeNow checks if the current time is within one or several given
periods of time. Result by errorlevel (yes:0, no:1)

A period of time is specified with starting and ending time (hh:mm)
separated by a dash. The minutes are optional. 24 hours mode only.

Examples: TimeNow 12:00-15:30
TimeNow 12 - 15 (means 12:00-15:00)

The second specification is "exclusive", that means: as soon as this
time is reached, the condition is no longer true.

If one of the two time specifications is missing, the default is 0:00
(resp. 24:00). The dash must not be omitted!

If the second time specification is earlier than the first one, the
period is assumed over midnight (!)

Beispiele: TimeNow 22- (22:00-24:00)
TimeNow -5:30 (00:00-05:30)
TimeNow 21:00-2:00 (over midnight)

Several periods of time may be specified, optionally separated by comma
or the word "or".

Example: TimeNow 12:00-12:30 or 22:10-23:00

Errorlevel 0 ok, condition true
1 not within
255 syntax error

Note: unter DR-DOS (Novell-DOS as well?) you must not use the word "or"
in a command line (system bug). Use comma or space.

----
TIMENOW is Freeware (c) Horst Schaeffer - no warranties of any kind
eMail: horst.schaeffer@gmx.net

= 04 AUG 2002

又及:楼上的zhri基本上在胡说八道。
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
论坛跳转: