home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HomeWare 14
/
HOMEWARE14.bin
/
utils2
/
sostb.arj
/
TOOLBOX.DOC
< prev
next >
Wrap
Text File
|
1993-05-19
|
22KB
|
888 lines
Solid Oak Software's DOS Tool Box
Over the past few years we have developed literally hundreds of little DOS
utilities for use on our own development computers. Some of the utilities
included in this package are duplicated by other companies, but most are not.
The ones that are, are for the most part, easier to use than other similar
utilities.
Most of the included utilities are best used in batch files, and most set the
DOS ErrorLevel to help you build conditional batch programs that are really
useful.
The following program reference assumes the reader has a reasonable working
knowledge of DOS batch files and DOS commands. Please refer to your DOS
reference manual for a complete discussion of batch files and ErrorLevels.
PROGRAM REFERENCE
ASK.COM
Syntax: ASK q
Options: q = a question phrase
Description: Returns ErrorLevel 1 if the answer is no.
Note: Appends a (Y/n) prompt to the end of the phrase. The user must
press a Y or an N to continue. If no key is pressed for a period
of one minute or the ENTER key is pressed, a Y or yes is
assumed.
Example: ASK Do you want to continue?
AUTOBOOT.COM
Syntax: AUTOBOOT time
Options: Time must be specified as 00:00 or 00:00:00
and must be in military (24 hr) format
Description: Automatically reboots computer at specified time.
Example: AUTOBOOT 00:01:00 will reboot the computer at 12:01 am.
AUTOBOOT 00:21:00 will reboot the computer at 11:00 PM.
CHIME.COM
Syntax: CHIME option
Options: /n number of times to chime (Defaults to 1)
/c chime until user presses a key
Description: Plays a chime sound.
DEFDRIVE.COM
Syntax: DEFDRIVE
Options: None
Description: Sets the DOS ErrorLevel to the number of the current default
drive. ( A=1 B=2 C=3 etc.)
DIRGE.COM
Syntax: DIRGE
Options: None
Description: Plays "Funeral Dirge".
DISKLEFT.COM
Syntax: DISKLEFT d
Options: d = drive letter (defaults to C:)
Description: Sets ErrorLevel to remaining free disk space in MB.
Example: If you have a 200 MB hard disk, and 20 MB free space remaining,
the ErrorLevel in this case will be set to 20.
Note: The maximum the ErrorLevel can be set to is 255. Drives that
have over 255 MB free space remaining will not cause the
ErrorLevel to be set properly.
See also: PCLEFT.COM PCUSED.COM DISKUSED.COM
DISKUSED.COM
Syntax: DISKUSED d
Options: d = drive letter (defaults to C:)
Description: Sets ErrorLevel to used disk space in MB.
Example: If you have a 200 MB hard disk, and 80 MB occupied disk space,
the ErrorLevel in this case will be set to 80.
Note: The maximum the ErrorLevel can be set to is 255. Drives that
have over 255 MB occupied disk space will not cause the
ErrorLevel to be set properly.
See also: PCLEFT.COM PCUSED.COM DISKLEFT.COM
EVERYDAY.COM Please see file EVERYDAY.DOC for details.
FAKEBADC.COM
Syntax: FAKEBADC
Options: None
Description: Simulates a hard disk error and locks computer.
FAKEBADN.COM
Syntax: FAKEBADN
Options: None
Description: Simulates a network error and locks computer.
FILEKB.COM *
Syntax: FILEKB filespec
Options: filespec = valid DOS file name
Description: Sets ErrorLevel to file size in kilobytes.
FILEAGE.COM *
Syntax: FILEAGE filespec
Options: filespec = valid DOS file name
Description: Sets ErrorLevel to the specified files age in months.
FORMFEED.COM
Syntax: FORMFEED n
Options: n = parallel port number (defaults to 1)
Description: Issues a form feed to the specified printer.
GOTODIR.COM
Syntax: GOTODIR
Options: none
Description: Used in conjunction with SAVEDIR.COM, this program will return
you to a previously "saved" drive and directory.
See also: SAVEDIR.COM
HDTYPE.COM
Syntax: HDTYPE n
Options: n = hard drive number (1 or 2)
Description: Sets ErrorLevel to drive type of the specified hard disk.
ISANSI.COM
Syntax: ISANSI
Options: None
Description: Sets ErrorLevel to 1 if ANSI.SYS is not installed.
ISASSIGN.COM
Syntax: ISASSIGN
Options: None
Description: Sets ErrorLevel to 1 if ASSIGN is not installed.
ISAPPEND.COM
Syntax: ISAPPEND
Options: None
Description: Sets ErrorLevel to 1 if APPEND is not installed.
ISBTWEEN.COM
Syntax: ISBTWEEN time1 time2
Options: Time1 and time2 must be specified as 00:00 or 00:00:00
and must be in military (24 hr) format.
Description: Sets ErrorLevel to 1 if the system time is between time1 and
time2. This function is usefull for determining if an action
should be performed if the system time is within a given time
frame.
Example: ISBTWEEN 12:00 13:00 would set the DOS errorlevel to 1 if the
system time was NOT between 12:00 noon and 1:00 pm.
See also: ISITAM.COM ISITPM.COM ISERLIER.COM ISBTWEEN.COM ISWKHRS.COM
ISCDROM.COM
Syntax: ISCDROM
Options: None
Description: Sets ErrorLevel to 1 if CD Rom is not installed.
Note: This program checks for a CD Rom driver only.
ISCLOCK.COM
Syntax: ISCLOCK
Options: None
Description: Sets ErrorLevel to 0 if real time clock is installed, 1 if the
clock date is set to 01-01-1980, 2 if clock not present.
Note: If the battery in an AT class computer causes the system to
loose its date setting, the date will almost always come up
as 01-01-1980. This could be added to an AUTOEXEC.BAT file
to check that the date has not been set to the default setting.
ISCOLOR.COM
Syntax: ISCOLOR
Options: None
Description: Sets ErrorLevel to 1 if color video card is not installed.
Note: Some monochrome systems are CGA compatible and will return
an ErrorLevel of 0 even though the monitor displays mono.
See also: WHATVID.COM
ISDESQ.COM
Syntax: ISDESQ
Options: None
Description: Sets ErrorLevel to 1 if DesqView is not running.
ISDOSKEY.COM
Syntax: ISDOSKEY
Options: None
Description: Sets ErrorLevel to 1 if DOSKEY is not installed.
ISDRIVE.COM
Syntax: ISDRIVE c
Options: c = valid drive letter
Description: Sets ErrorLevel to 1 if specified drive is not ready.
See also: ISFILE.COM
ISEMS.COM
Syntax: ISEMS
Options: None
Description: Sets ErrorLevel to 1 if EMS driver is not installed.
ISERLIER.COM
Syntax: ISERLIER time
Options: Time must be specified as 00:00 or 00:00:00
and must be in military (24 hr) format
Description: Sets ErrorLevel to 1 if the system time is not earlier
than time specified.
See also: ISLATER.COM ISWKHRS.COM ISBTWEEN.COM ISITAM.COM ISITPM.COM
ISFILE.COM
Syntax: ISFILE filespec
Options: filespec is any valid DOS filename or drive letter
Description: If the specified file does not exist, or the drive that was
specified is not ready, the program sets an ErrorLevel of 1
Note: This is a useful function to use from batch files if you want
to run a program from a floppy disk like a virus detection
program. You can use ISFILE to check that a disk is in the
specified drive and that the desired file is on the disk before
proceeding. (i.e. ISFILE b:viruschk.exe)
See also: ISDRIVE.COM
ISITAM.COM
Syntax: ISITAM
Options: None
Description: Sets ErrorLevel to 1 if the system time is after 12 noon.
See also: ISITPM.COM ISLATER.COM ISERLIER.COM ISBTWEEN.COM ISWKHRS.COM
ISITPM.COM
Syntax: ISITPM
Options: None
Description: Sets ErrorLevel to 1 if the system time is before 12 noon.
See also: ISITAM.COM ISLATER.COM ISERLIER.COM ISBTWEEN.COM ISWKHRS.COM
ISLATER.COM
Syntax: ISLATER time
Options: Time must be specified as 00:00 or 00:00:00
and must be in military (24 hr) format
Description: Sets ErrorLevel to 1 if the system time is not later
than time specified.
See also: ISITAM.COM ISITPM.COM ISERLIER.COM ISBTWEEN.COM ISWKHRS.COM
ISMATH.COM
Syntax: ISMATH
Options: None
Description: Sets ErrorLevel to 1 if math chip is not installed.
ISMOUSE.COM
Syntax: ISMOUSE
Options: None
Description: Sets ErrorLevel to 1 if mouse driver is not installed.
Note: This program does not check for the physical presence of a
mouse, only the driver (i.e. MOUSE.COM ).
ISNETBIO.COM
Syntax: ISNETBIO
Options: None
Description: Sets ErrorLevel to 1 if no NETBIOS compatible driver is loaded.
ISNEWDSK.COM
Syntax: ISNEWDSK d
Options: d = drive letter ( A or B )
Description: Sets ErrorLevel to 1 if specified floppy disk has not been
changed since last access.
Note: An empty disk drive will return an ErrorLevel of 1 since a
new disk has not been inserted yet.
ISPRINT.COM
Syntax: ISPRINT n
Options: n = parallel port number
Description: Sets ErrorLevel to 1 if printer is not on line and ready.
ISPRINTX.COM
Syntax: ISPRINTX
Options: None
Description: Sets ErrorLevel to 1 if PRINT.EXE is not installed.
ISREMOVE.COM
Syntax: ISREMOVE d
Options: d = drive letter
Description: Sets ErrorLevel to 1 if specified drive is NOT a removable
(floppy) drive type.
ISSHARE.COM
Syntax: ISSHARE
Options: None
Description: Sets ErrorLevel to 1 if SHARE.EXE is not installed.
ISTEXT.COM
Syntax: ISTEXT c
Options: c = any string of text to find
Description: Scans current screen contents for text specified when run.
Sets ErrorLevel to 1 if text is not found on screen.
Example: ISTEXT error
If the text "error" is found anywhere on the screen, the
ErrorLevel will be set to 0. NOT case sensitive.
ISTODAY.COM
Syntax: ISTODAY day [day1] [day2] ...
Options: day = the name if any day of the week (i.e. Monday Tue )
Description: Sets ErrorLevel to 1 if system date indicates the current day
is not one of the days specified.
Example: ISTODAY Mon tue WED Thursday
If the current day of the week is NOT one of the ones
specified, the ErrorLevel would be set to one.
Note: This program is usefull in batch files where you want or don't
want an action to be performed on a certain day or group of
days.
See also: ISWKDAY.COM
ISVOL.COM
Syntax: ISVOL drive volume
Options: drive = valid drive letter ( A B C etc.)
volume = volume name to check for
Description: Sets ErrorLevel to 1 if the volume name of the specified drive
does not match the specified volume name.
Note: This program is useful in creating installation batch files
and other routines where you want to check to see that a
particular disk is in a floppy drive. For example you might
have a set of three disks that must be inserted in the correct
order. You could set the volume labels ( see VL.COM ) to
DISK1 DISK2 and DISK3. You could then check for the correct
volume name with ISVOL.COM before performing an action.
ISWKDAY.COM
Syntax: ISWKDAY
Options: None
Description: Sets ErrorLevel to 1 if system date indicates the current day
is not a work day, Mon-Fri.
See also: ISTODAY.COM
ISWKHRS.COM
Syntax: ISWKHRS
Options: None
Description: Sets ErrorLevel to 1 if system time indicates the current
is not between 8am and 5pm.
See also: ISERLIER.COM ISLATER.COM
ISXMS.COM
Syntax: ISXMS
Options: None
Description: Sets ErrorLevel to 0 if an extended memory driver is installed,
1 if not.
LOCKUP.COM
Syntax: LOCKUP
Options: None
Description: Locks up computer forcing re-boot.
NOBREAK.COM
Syntax: NOBREAK
Options: /u (unloads program)
Description: TSR disables Ctrl-C and Ctrl-Break
PCLEFT.COM
Syntax: PCLEFT d
Options: d = drive letter (defaults to C:)
Description: Sets ErrorLevel to remaining free disk space in as a percentage
Example: If you have a 200 MB hard disk, and 20 MB free space remaining,
your free disk space is 10%. The ErrorLevel in this case will
be set to 10.
See also: PCUSED.COM DISKLEFT.COM DISKUSED.COM
PCUSED.COM
Syntax: PCUSED d
Options: d = drive letter (defaults to C:)
Description: Sets ErrorLevel to the amount of occupied (used) disk space
as a percentage
Example: If you have a 200 MB hard disk, and 150 MB of used disk space,
your free disk space is 25%. The ErrorLevel in this case will
be set to 25%.
See also: PCLEFT.COM DISKLEFT.COM DISKUSED.COM
PF.COM
Syntax: PF filename [/port]
Options: filename = any valid DOS file specification including wild cards
port = optional printer port number (1,2 or 3). Defaults to 1.
Description: Prints specified file(s) to printer with header indicating time,
date, file size, etc.
PRTSCRN.COM
Syntax: PRTSCRN n
Options: n = parallel port number (defaults to 1)
Description: Prints current screen and form feed to specified printer. Also
date and time stamps printout and specifies network node if
installed on a network.
QFLOPS.COM
Syntax: QFLOPS
Options: None
Description: Sets ErrorLevel to number of floppy drives installed.
QPPORTS.COM
Syntax: QPPORTS
Options: None
Description: Sets ErrorLevel to number of parallel ports installed.
QSPORTS.COM
Syntax: QSPORTS
Options: None
Description: Sets ErrorLevel to number of serial ports installed.
REBOOT.COM
Syntax: REBOOT
Options: None
Description: Reboots computer
RING.COM
Syntax: RING option
Options: /n = number of times to ring (defaults to 1)
/c ring until user presses a key
Description: Plays a ringing sound.
SAVEDIR.COM
Syntax: SAVEDIR
Options: none
Description: Used in conjunction with GOTODIR.COM, this program will "save"
the current drive and directory information when ever you run
the program. You can then run GOTODIR at any time later to
return to the original drive and directory.
See also: GOTODIR.COM
SAVSCRN.COM
Syntax: SAVSCRN filespec
Options: filespec = any valid DOS file name and path
Description: Captures the current text screen to the specified file. If the
file already exists, it will append to the end of the file. It
date and time stamps the capture and specifies network node if
installed on a network.
SIREN.COM
Syntax: SIREN option
Options: /n = number of times to loop (defaults to 1)
/c = loops until user presses a key
Description: Plays a siren type sound.
START.COM
Syntax: START expression
Options: expression = a comment of some kind.
Description: Starts a timed event sequence. Not a TSR.
Records information in PC-Sentry log file if installed.
Example: START Word processing
STOP.COM
Syntax: STOP
Options: none
Description: Displays the elapsed time since START.COM was run.
Records information in PC-Sentry log file if installed.
VL.COM
Syntax: IV drive volume
Options: drive = valid drive letter ( A B C etc.)
volume = new volume name
Description: Sets or resets the volume name of the specified drive.
WAIT.COM
Syntax: WAIT n
Options: n = seconds to wait
Description: Waits a specified number of seconds.
WEEKOFMO.COM
Syntax: WEEKOFMO
Options: None
Description: Sets ErrorLevel to current week of the month.
Note: This function returns the actual week of the month, NOT the
Nth 7 day period. The actual week is calculated on a 7 day
basis from Sunday morning to Saturday night. For example,
if the 1st falls on a Wednesday, then Wednesday through Saturday
is counted as week 1. In this case, week 1 is actually only
4 days long. Week 2 begins with Sunday and is in 7 day cycles
after that.
WEEKOFYR.COM
Syntax: WEEKOFYR
Options: None
Description: Sets ErrorLevel to current week of the year.
Note: This function returns the actual week of the year, NOT the
Nth 7 day period. The actual week is calculated on a 7 day
basis from Sunday morning to Saturday night. For example,
if Jan 1 falls on a Wednesday, then Wednesday through Saturday
is counted as week 1. In this case, week 1 is actually only
4 days long. Week 2 begins with Sunday and is in 7 day cycles
after that.
WHATCPU.COM
Syntax: WHATCPU
Options: None
Description: Sets ErrorLevel to 1 for 8086-8088, 2 for 80286, 3 for 80386,
4 for 80486.
WHATDATE.COM
Syntax: WHATDATE
Options: None
Description: Sets ErrorLevel to the current calendar date. (date of the mo)
Example: If the system date is May 19, then ErrorLevel is set to 19.
WHATDAY.COM
Syntax: WHATDAY
Options: None
Description: Sets ErrorLevel to the current day of the week. 1 for Sunday
2 for Monday, 3 for Tuesday, and so on.
WHATDOS.COM
Syntax: WHATDOS
Options: None
Description: Sets ErrorLevel to the DOS major version number.
Example: If the your DOS version is 3.3 then ErrorLevel is set to 3.
If the your DOS version is 4.01 then ErrorLevel is set to 4.
WHATEMS.COM
Syntax: WHATEMS
Options: None
Description: Sets ErrorLevel to the EMS driver major version number, 4 for
4.00 etc.
WHATFLOP.COM
Syntax: WHATFLOP d
Options: d = drive letter
Description: Sets ErrorLevel to correspond to the type of floppy disk drive
installed in the specified drive.
0 = not installed
1 = 5¼ inch 360 KB
2 = 5¼ inch 1.2 MB
3 = 3½ inch 720 KB
4 = 3½ inch 1.44 MB
5 or greater = unknown drive type
WHATHOUR.COM
Syntax: WHATHOUR
Options: None
Description: Sets ErrorLevel to the current hour in 24 hour format.
Example: If the time is 1:00pm the ErrorLevel is set to 13.
WHATKB.COM
Syntax: WHATKB
Options: None
Description: Sets ErrorLevel to 0 for US keyboard, 1 to foreign.
WHATMO.COM
Syntax: WHATMO
Options: None
Description: Sets ErrorLevel to the current month number. (1-12)
Example: If the current month is May the ErrorLevel is set to 5.
WHATVID.COM
Syntax: WHATVID
Options: None
Description: Sets ErrorLevel video type setup as follows:
1 = Monochrome adapter
2 = Hercules adapter
3 = CGA adapter
4 = EGA adapter with monochrome monitor
5 = EGA adapter with color monitor
6 = VGA adapter with monochrome monitor
7 = VGA adapter with color monitor
8 = MCGA adapter with monochrome monitor
9 = MCGA adapter with color monitor
10 = EGA adapter with color CGA monitor
11 = IBM 8514/A adapter