标题: 各位大虾快来帮帮我好吗??????
[打印本页]
作者: zsc0623
时间: 2004-7-10 00:00
标题: 各位大虾快来帮帮我好吗??????
我是个菜鸟,有个问题想请教各位,我想在dos里,在指定的时间段内,重起机器是启动一些程序,请各位教教我好吗
作者: zhri
时间: 2004-7-11 00:00
用程序写吧。
DOS不是一种汇编。
DOS也不是什么语言。
只是,因为当时存储器很贵(内存、外存),不可能用Windows。
DOS命令你可以把他想象成,一大段程序,然后去掉了花哨的外客和说明文件,直接的中间的核心代码。(除了干完某件事外,什么都没有)
批处理的功能很弱的。他不可能驻留内存。DOS运行程序是独享的,所以,这样才会让人家想出驻留程序的办法.......
。。。。。。
作者: Climbing
时间: 2004-7-11 00:00
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基本上在胡说八道。