中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-16 19:57
47,813 主题排行 / 349,903 发帖 / 今日 0 篇 / 48,259 会员排行
DOS疑难解答 & 问题讨论 (解答室) » 各位大虾快来帮帮我好吗??????
可打印版本  4,977 / 2
第1楼 zsc0623 发表于 2004-07-10 00:00
初级用户 发帖 1 积分 103
各位大虾快来帮帮我好吗??????
我是个菜鸟,有个问题想请教各位,我想在dos里,在指定的时间段内,重起机器是启动一些程序,请各位教教我好吗
第2楼 zhri 发表于 2004-07-11 00:00
高级用户 发帖 153 积分 665
用程序写吧。

DOS不是一种汇编。

DOS也不是什么语言。

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

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

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

。。。。。。
第3楼 Climbing 发表于 2004-07-11 00:00
铂金会员 发帖 2,753 积分 6,962 来自 河北保定
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基本上在胡说八道。
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023