Batch Utilities for DOS

Back to Front Page

global menu:


This page under construction. This page is primarily devoted to batch utils that enhance or supplement the DOS batch language. No attempt has been made to be exhaustive. Batch-driven programs (e.g., menus) are listed on other pages. Most of these utils were developed exclusively for DOS and may not operate as expected under Win9x and/or NT. A very big thanks to Howard Schwartz who suggested and commented on many of the programs on this page. Power users should probably check out the following references.


FORTUNE- Enhanced FOR.

unrated [added ; updated]

FORTUNE "extends the functionality of the DOS FOR command by providing ways of splitting up the parts of the file name and manipulating the parts." Translate variables into drive, path, filename root, filename extension, and filename characters. Author: Bruce Guthrie/ Wayne Software; Suggested by Howard Schwartz.

Version history: v906 released 6-99. See Wayne Software

download fortn906.zip (85K)


ERR2ENV- Set current errorlevel to an environment parameter.

unrated [added 07-07-99]

"Dos IF statements need a lot enhancing to test for various conditions: err2env.zip is a life saver that lets you store the current error level in an environment variable and/or set it yourself." Author: Zhuhan JIANG, Australia (1994) Home Page.; Suggested by Howard Schwartz.

Syntax:
err2env [/qnàx#+#-#[,envpara]] or
err2env "/<>qnàx#+#-#t#[,envpara]" [fileout [filein] ]
         where # represents an positive integer.

q    - quiet with no non-critical messages
n    - environment parameter ERR_LEVEL will not be changed
x#   - exit with errorlevel specified by #
+#   - exit errorlevel will be the entry errorlevel plus #
-#   - exit errorlevel will be the entry errorlevel minus #
à    - remove stored errorlevel addresses from ERR2ENV.EXE.
,env - set errorlevel to the environement parameter specified
       by "env"

Notes: May not work properly under Win9x (recursive shell failures).

download err2env.zip (18.3K)


TESTIF- Test for system, disk, time, and file conditions in batch files.

unrated [added 07-07-99]

Tests for: VideoMode, VideoPage, ScreenWidth, Year, Month, Day , DayOfWeek, Hour, Minute , Second , WriteVerify, DosVersion, MinorDosVersion, CurrentDrive, Drives, Floppies, SerialPorts, ParellelPorts, CapsLock, NumLock, ScrollLock, MemSize, Random, SectorsPerCluster(n) BytesPerSector(n), FreeClusters(n), TotalClusters(n), FreeSpace(n), TotalSpace(n) , Exist , FileSize , FileAttr , FileDate , Mem(A:B), MemW(A:B), Port(A). Author: Marc Perkel, Computer Tyme Software. (1990); Suggested by Howard Schwartz.

download testif.zip (12K)


TEST- Test for file/directory status in batch files.

unrated [added 07-07-99]

"test evaluates the expression <expression> and, if its value is true, returns a non-zero (true) exit status; otherwise, a zero (false) exit status is returned. test returns a zero if there are no arguments."

Primitive operators testing one file:

Primitive operators comparing two files:

The above operators can be combined with logical (AND, OR) operators.

Author: Jason Mathews. (1994); Suggested by Howard Schwartz.

download test.zip (14K)


"The DOS SET variable needs help. In each program below there is some non-overlap between the kinds of information and ways to manipluation text strings and set them to a variable."

ADVSET

unrated [added 07-07-99]

"Advset lets you delete, append to, prepend to an already existing variable. It also lets you convert values to all caps, all small letters, etc." Author: Kåre Fundal, Denmark (1995) Home Page ; Suggested by Howard Schwartz. Newer ftp://konrad.ruc.dk/pub/kf/advset16.zip is available but is shareware (1997).

download advset14.zip (12K)

ASET

unrated [added 07-07-99]

"ASET lets you store all kinds of information in a variable, and do arithmetic as well (a big lack in batch files)." Author: Richard Breuer, Germany (1993); Suggested by Howard Schwartz.

download aset10.zip (80K)

Strings

unrated [added 07-07-99]

"Strings does similar things to ASET, but takes up less memory." Author: Douglas Boling (1995); Suggested by Howard Schwartz.

download string25.zip (75K)


INPUT- Get console input from within a batch file.

unrated [added 07-07-99]

"There are a lot of freeware programs that do what Dos CHOICE does, but better -- getting input from the keyboard. input.zip is an old one (87) I have used for years. It puts whatever you type in a variable, and also lets you set up the prompt so it takes only y/n answers, converts your input to caps, etc. " Author: William C. Parke (1987); Suggested by Howard Schwartz.

download input.zip (3K)


"There are many freeware equivalents to the Unix sleep command (wait n seconds before doing the next command." One of these is ftp://ftp.cdrom.com/pub/simtelnet/msdos/batchutl/sleep25.zip ; another is...

SLEEP- Batch util sleeps until event occurrence.

* * * * * [added 3-21-98]

A very flexible command line tool for scheduling events; intended for batch files. "The possible events are: FOR a length of time, TILL a certain time, a question ASKed of the user, certain FILESPECS appear or disappear, the UPS is active, or a SCHEDuled event. Commands can be combined. Sleep is DOS, DesqView (uses DV System Memory), OS/2, and Windows aware.

Usage:
INDIRECT COMMAND FILE.Sleep "@"<file>
FOR syntax............Sleep for [[hh":"]mm":"]ss
TILL syntax...........Sleep till [[hh":"]mm":"]ss
ASK syntax............Sleep ask '<prompt string>' <responses>
FILESPECS syntax......Sleep ["&"]"+"|"-"<filespec> ...
PAR and SER syntax....Sleep par|ser <port adr> <out> "+"<in> "-"<in>
SCHED syntax..........Sleep sched <file>

No documentation- type SLEEP /? for extended help screens. Author: John R. Souvestre (1997)

download sleep_47.zip (33K)

COUNTDN- Launch program after countdown- with keypress abort option.

* * *

From the docs... "This program will launch any specified program (EXE, COM, or BAT) after a countdown of a specified number of seconds. The countdown may be aborted and the program launched immediately by pressing the ENTER key. Pressing the SPACE or ESC key will stop the countdown without launching the program.

This is ESPECIALLY useful for programs that run from the AUTOEXEC.BAT file (like Windows) that you may not want to run EVERY time. This is easier than maintaining multiple configuration files. There are two ways to run COUNTDN: Regular mode and Advanced Mode. The difference is that regular mode is very easy to use, but adds a small amount of memory overhead (3-4 K) to the launched program. Advanced mode is a little more complex to use, but does not take any memory from the launched program." Default countdown beeps can be turned off with /Q switch. Released by David C. Filmer. 1994.

Not as flexible as SLEEP- but more "visual" and easy to use.

download countdn.zip (31K)


XECHO- Echo replacement useful for batch generation and creating logfiles.

unrated [added 07-07-99]

"The echo command often needs enhancement so you can put any ascii character in a file, or echo something to a file without starting a new line. The latter is handy for building commands in a 2nd batch file, created by a first batch file. XECHO is an enhanced echo that does these things and also lets you echo all kinds of information to the screen. XECHO also allows echoing of redirection symbols."

download xecho133.zip (84K)

Also see LOGECHO in HORST batch utilities collection


Batchman.

Old but packs many batch utils into a single program.

Syntax: BATCHMAN [command] [arguments] [/R]
/R = Display ErrorLevel

CLS [nn]  nn[H]=color H=hex            CECHO [C] [nn,]string  nn=color;C=no CR
SETLOOP n  n=loops (0-255)             DEC  decrements SETLOOP  EL=SETLOOP
QFORMAT [d:] [N] d:=A: or B: N=No ask  BREAK  EL=1 if break ON
PUSHPATH  EL=0 if successful           POPPATH  EL=0 if successful
ANSI  EL=0 if installed                BEEP [m,n[;m,n]...]  m=freq. n=1/18 sec
WAITTIL hh:mm[:ss]                     WAITFOR [mm:]ss
CURSORTYPE m,n  m=start; n=stop line   DRIVEEXIST d:  EL=1 if exist
DIREXIST directory  EL=1 if exist      ISVOL [d:]volume  EL=1 if exist
YEAR  EL=year from 1980 (0-199)        MONTH  EL=(1-12)
DAY   EL=(1-31)                        WEEKDAY  EL=(0-6) Sun=0; Sat=6
HOUR  EL=(0-23)                        MINUTE  EL=(0-59)
SECOND EL=(0-59)                       VIDEOMODE  EL=(0-19)
ROWS  EL=display rows                  COLS  EL=display columns
SETCURSOR m,n  m=row; n=col            E43V50
PRTSC [F]  F=formfeed                  COMPARE string string  EL=0 if match
CANCOPY filespec [d:]  EL=0 if room to copy
WARMBOOT                               COLDBOOT
SHIFT ALT | CTRL  EL=1 if depressed    NUMLOCK [ON | OFF]
CAPSLOCK [ON | OFF]                    SCROLLOCK [ON | OFF]
RENDIR old new  EL=0 if successful     ROMDATE  display BIOS date
GETKEY ['string' n] n=Function key EL=position; EL=scan code if no list
DOSVER  EL=x where x=(major*32)+minor; eg. DOS 3.30=(3*32+30)=126
MAINMEM n | R  main memory;  n=K bytes needed; EL=0 if enough; R=report
EXPMEM n | R  expanded memory          EXTMEM n | R  extended memory

Author: Michael Medford/ PC Mag (1989)

download vol9n02.zip (59K)


RAMBAT- Stores batch files in one file, use in RAM disk.

unrated [added 07-07-99]

"Rambat is an interesting utility that stores all your small batch files in one file, and then puts them all in your ramdisk as single batch files." The purpose of the program is to reclaim wasted disk space allocated to (usually) tiny batch files. (You'll have to be willing to accept the memory penalty imposed by a RAM disk.) Author: Jay E. Morris (1992)

download rambat1.zip (5K)


FDATE (2)- Multi-purpose date manipulation/ format utility for batch files.

unrated [updated 12-06-98]

Fdate is a utility for performing date formatting and date arithmetic in DOS batch files. Includes a variety of means for placing output into environment variables which can be then be manipulated in numerous ways in a batch file. Detailed and brief help documentation included; multiple help screens. This program is admittedly beyond my comprehension- but it is too interesting to ignore. Author: Stephen Ferg (1997).

Features from the documentation:

New in v 96a: minor update for justifying NT text; docs address NT issues.

download fdate96a.zip (85K)


HORST- Batch utility collection.

* * * * * [updated 6-17-98]

I tend not to include batch utility sets in this list, but even my limited mind can recognize the diversity, quality, and usefulness of this compilation. From a reader..."All hand-crafted assembler, tiny and incredibly fast. More than a power-users batch toolkit. There is something here for everybody. How can anyone manage without it?" With excellent, separate documentation for each program. Author: Horst Schaeffer, Germany. (1998). Suggested by Robert Bull.

Included programs:

ANSICHK  returns errorlevel 0 if ANSI driver detected
ANSIEX   remove ANSI sequences, emulating cursor movements
ASCREEN  display screen from file, ANSI emulation
BANNER   big font looping message
BIGFONT  display big characters (4 lines high), round pixels
CHOIX    CHOICE clone with mouse support
COUNT    Count, add, subtract (variable), fixed length option
CRC32    report and check CRC32, optional list processing
CRLF     convert: lines to be terminated by CR+LF, CR or LF
CSCRIPT  DEBUG/UU/XXencoded script generator with CRC32
CSOUND   sound output to PC speaker / resident beep replacement
DELAGE   delete/report files by age (days)
DREADY   disk(ette) ready?, optional check "ready to write"?
ESPACE   environment variable space report/check with errorlevel
EVERY    run jobs once a day / on specified days of week
FPATH    locate path of program file, optional CD
INPUT    string input, editing of existing variable..
ISDATE   compare date (also file date, today)
KPUSH    stuff keystrokes into keyboard buffer, code test mode
LINEX    extract [multiple] range of lines from ASCII file
LISTMOD  make list of commands from input list
LOGECHO  custom entries for logfiles, with enhanced date handling
LOGTRIM  trim logfiles (min/max KB)
NSET     pipe data from STDIN into an environmental variable
PACO     executable COM file archive (run with prefix)
PCHECK   checks if (parallel) printer is ready, optional reset
QECHO    "quote echo" with control codes, defaults without CR/LF
RANDOM   random number (given range) to STDOUT
TIMENOW  current time within given period(s)?
WAIT     wait with prompt, key by errorlevel
WAIT4    wait for/until with large "digital clock", options
WHAT     errorlevel for: hour/minute/year/month/day/day of week

update 6-17-98: New programs added: FPATH, TIMENOW. See Home page for other update information.

download horst31.ZIP (68K)


Pause substitutes...

1. HoldIt- PAUSE replacement time-outs after specified time.
2. MPause- PAUSE replacement uses mouse or keys to answer prompt.
3. Press- PAUSE substitute with OK button box, mouse support, time-out option.

  1. HoldIt: * * * Differs from PAUSE in it's ability to timeout after a specified period of time (seconds). HoldIt can also return error level messages. If you use MS-DOS 6+, also look at the CHOICE command which can work in a similar fashion. Author: Peter Strickler, Switzerland (1993).
  2. MPause: * * "If a mouse is detected, then the program waits for any key stroke OR any mouse button press. It prompts you to press any key or mouse button. If no mouse is present, then the action is identical to that of the PAUSE command, including the identical prompt to press any key." Doesn't add a new line after return. Author: C. Somerville. (1992). Also see: PAWS.
  3. PRESS: * * * Yet another replacement for the PAUSE command. By default it darkens the screen and displays an OKAY button box. The only problem with this design is that the box can sometimes obscure potentially important screen text. You can add text to the button box, and also use both ok/cancel buttons with errorlevels for decision branching in batch files. Option to time-out after x seconds. Mouse support too. Author: George Kerber (1995)
  1. download holdit10.zip (7K)
  2. download mpause.zip (3.4K)
  3. download press.zip (30K)



[ Go to Top | Front Page ]

© 1994-1999. Rich Green