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-15 16:09
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » [Help] How can a usage period be implemented for a batch file under pure DOS? View 997 Replies 2
Original Poster Posted 2009-08-16 10:25 ·  中国 宁夏 银川 电信
新手上路
Credits 11
Posts 5
Joined 2009-06-22 02:17
17-year member
UID 147885
Gender Male
Status Offline
How can a usage period be implemented for a batch file under pure DOS?
After the first run, create a file to record the year, month, and day.
Then set the usage period to 1 year. Each time it runs, first read the file that records the date.
For example, if it is run on 2009.8.16, then the batch file's expiration time would be before 2010.8.16; if it is run on 2010.8.16 or any day after that, it deletes itself.
Floor 2 Posted 2009-08-16 15:00 ·  中国 广东 东莞 电信
新手上路
四眼
Credits 13
Posts 8
Joined 2009-05-04 09:12
17-year member
UID 144370
Gender Male
Status Offline
Does it need to be executed at boot?
从DOS开始
Floor 3 Posted 2009-08-16 20:46 ·  中国 宁夏 银川 电信
新手上路
Credits 11
Posts 5
Joined 2009-06-22 02:17
17-year member
UID 147885
Gender Male
Status Offline
Yes, at boot, run autoexec.bat under DOS.
Forum Jump: