Batch Utilities for DOS [page 1 of 2]

Back to Front Page

global menu:


Notes: This page includes batch utils (not batch files) that enhance / supplement the DOS batch language. The list does not reflect an exhaustive search. For batch files, tips, and tutorials see OTHER BATCH RESOURCES.

Most of the utils below 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.



An incomplete list of Batch resources on the Web (some of the following sites also have good meta-lists of additional batch resources):


IF

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 environment 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 <FileName> , FileSize <FileName>, FileAttr <FileName>, FileDate <FileName>, 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)


SET ENHANCERS

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)


ECHO ENHANCERS


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." Author: Claus-Juergen Claussen, Germany (1998) Sugg. by Howard Schwartz, others.

download xecho133.zip (84K)


SEND- ECHO enhancer.

unrated [added 09-12-99]

From the docs: "SEND is intended to remedy....defects of ECHO:

  1. It does not terminate line in a CR-LF combination; one can add such a pair "by hand".
  2. Typing "send ^G" is equivalent (except for the lack of a CR-LF) to typing "echo <Ctrl G>" so one need not fill files with control characters.
  3. Typing "send ^[E > prn" will send a <Esc>E to the printer thereby turning on "emphasized" print.
  4. In addition....SEND supports the PROMPT $- characters."

Author: Howard Rumsey and Barry Simon (1985); Sugg. by Howard Schwartz, source: Laurence Soucy's Batfiles: The DOS batch file programming handbook.

download send.zip (12K)


QECHO & LOGECHO- ECHO enhancers.

Somewhat similar to XECHO; for description/ link see: HORST batch utilities collection.


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)

FOR


FORTUNE- Enhanced FOR.

unrated [added 07-07-99 updated 09-04-99]

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 (1999); Suggested by Howard Schwartz.

11-23-99: v911 released 11-99. See Wayne Software

http://www.geocities.com/SiliconValley/Lakes/2414/fortn911.zip (85K)


INPUT


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)


DATE


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

unrated [updated 09-13-00]

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.

Features from the documentation:

Author: Stephen Ferg (2000), Home Page.

09-13-00: replaced v0.96a with v1.4a (08-00). Home page added.

download fdate14a.zip (123K)

Get HTML manual here: fdate14a_html_doc.zip (252K)


MORE...

[ Go to Top | Front Page ]

© 1994-2000. Rich Green