Category : Information about the Internet from the early 1990's
Archive   : SLIP_DOS.ZIP
Filename : TIMEKEY.DOC
*********************************************************************
TIMEKEY.COM
*********************************************************************
ORIGIN: TIMEKEY.COM was produced out of the commonly
expressed need for a batch file utility that
would not only suspend the execution of a batch
file for a specified number of seconds, but which
would also return the errorlevel code of any key
pressed before the specified time... and then
return to the batch file. Though I worked on the
problem for quite some time, my efforts proved
fruitless... until I combined my original code
from the program KEY.COM with the code from the
program WAIT.COM written by Ken Goosens. The
program TIMEKEY.com was literally produced by a
simple "copy" command... and voila! The program
proved itself so useful that I continued to work
on the problem while at the same time trying to
contact Ken Goosens (whoever he is!). I have been
unable to find the whereabouts of this person for
several months and have decided that such a useful
program must be released into general use for all
to enjoy. Since Mr. Goosen's program was released
into the public domain without any provisos, as was
my KEY.COM program, I hope and trust that Mr. Goosens
will embrace this new program with the same spirit
with which I now place it in the public domain.
Thanks Ken... whoever and wherever you are!
PROGRAM: timekey.com
FUNCTION: suspends execution of a batch file for a specified
number of seconds or until any key is pressed,
then returns an errorlevel equal to the
ASCI code of the key that was pressed... or an
errorlevel code of zero if no key was pressed
INSTALLATION: none
FORMAT: timekey s
where s = pause time in seconds from 1 to 59
EXAMPLES: used in batch files with conditional errorlevel
checking and timed delay
sample.bat
echo off
cls
echo Enter your choice by pressing a key:
echo A first selection
echo B second selection
echo C third selection
timekey
if errorlevel 67 if not errorlevel 68 goto third
if errorlevel 66 if not errorlevel 67 goto second
if errorlevel 65 if not errorlevel 66 goto first
if errorlevel 0 if not errorlevel 1 goto huh
:first
echo You selected choice A
goto end
:second
echo You selected choice B
goto end
:third
echo You selected choice C
goto end
:huh
echo You did not select an option within the allowed time.
:end
cls
OTHER EFFECTS: none known
SYSTEM REQ'D: works with DOS 2.X and 3.X
NOTES: Thanks to Ken Goosens. Please read "ORIGIN". For the
sake of completeness, I have included the original
program descriptions for both WAIT.COM by Ken Goosens
and KEY.COM.
AUTHOR: Ken Goosens (unknowingly) & David Creasey 1988
************************************************************************
************************************************************************
PROGRAM: WAIT.COM
GENERAL FUNCTION: Idles machine for specified number of seconds.
WHY IS IT NEEDED? In batch processing, you often want a specified
amount of time to elapse between events. For example, you want a
display to be on the screen for 5 second, then move on.
INSTALLATION: None.
FORMAT: WAIT n
where n= an integer, and is the number of seconds to wait.
EXAMPLES: WAIT 10
HOW TO USE IT: In batch files (extension .BAT) - to delay between
events.
OTHER EFFECTS: None.
SYSTEM REQUIREMENTS: Works with DOS 1.1 and 2.0.
COMMENTS: Does not use clock, so is possible timing may not be same
on compatibles.
SOURCE OF PROGRAM: Ken Goosens
*********************************************************************
*********************************************************************
KEY.COM
*********************************************************************
PROGRAM: key.com
FUNCTION: pauses for single keystroke from console,
then returns an errorlevel equal to the
ASCI code of the key that was pressed
INSTALLATION: none
FORMAT: key
EXAMPLES: used in batch files with conditional errorlevel
checking
sample.bat
echo off
cls
echo Enter your choice by pressing a key:
echo A first selection
echo B second selection
echo C third selection
key
if errorlevel 67 if not errorlevel 68 goto third
if errorlevel 66 if not errorlevel 67 goto second
if errorlevel 65 if not errorlevel 66 goto first
:first
echo You selected choice A
goto end
:second
echo You selected choice B
goto end
:third
echo You selected choice C
:end
OTHER EFFECTS: used alone (without errorlevel checking) the program
pauses execution of the batch file until the user
presses a key at the console
SYSTEM REQ'D: works with DOS 2.X and 3.X
NOTES: employs DOS interrupt 21H function 07H
AUTHOR: David Creasey 1987
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/