home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-14 | 211.7 KB | 4,508 lines |
-
-
-
-
-
- CFG
-
- Version 2.43
-
-
-
-
-
-
- Copyright Special Enhancements 1992 - 1995
- All Rights Reserved
-
-
-
-
- Software Manual
-
-
-
-
- -- Shareware Version --
-
-
-
-
- Mark Treadwell
- 4 Mumford Avenue, Apt A
- Newport, Rhode Island 02840-1719
- USA
-
-
- CompuServe: 73700,3344
- Prodigy: WNBH41A
- Internet: 73700.3344@compuserve.com
-
-
-
- Contents
-
-
-
-
- CONTENTS 2
-
-
- CHAPTER 1: INTRODUCTION 4
-
- 1.1 Basic Operation 4
-
- 1.2 System Requirements 4
-
- 1.3 Disk Files Included with CFG 5
-
- 1.4 Documentation 5
-
- 1.5 Acknowledgments 6
-
-
- CHAPTER 2: REGISTRATION - WHY AND HOW 7
-
- 2.1 Definition of Shareware 7
-
- 2.2 Disclaimer - Agreement 7
-
- 2.3 What You Get 8
-
- 2.4 How To Register 8
-
-
- CHAPTER 3: INSTALLATION 10
-
- 3.1 Procedure 10
-
- 3.2 Locations 10
-
- 3.3 Quick Help 10
-
-
- CHAPTER 4: USE 11
-
- 4.1 Command Line Syntax 11
-
- 4.2 Global Switches 11
-
- 4.3 Switch Usage 12
-
- 4.4 MultiCommand Mode 13
-
- 4.5 Number Base 13
-
- 4.6 Return ErrorLevel 13
-
- 4.7 Messages 14
-
- 4.8 Notes 14
- 4.8.1 Usage From CONFIG.SYS and the Command Line 14
- 4.8.2 On Loading High 15
- 4.8.3 Case on the Command Line 15
- 4.8.4 DOS Environment 15
- 4.8.5 Undocumented DOS 17
-
-
- CHAPTER 5: COMMANDS 19
-
-
- APPENDIX A: PROBLEMS AND SOLUTIONS 69
-
-
- APPENDIX B: BIBLIOGRAPHY 70
-
-
- APPENDIX C: REVISION HISTORY 71
-
-
- APPENDIX D: BACKGROUND DISCUSSION 78
-
-
- APPENDIX E: ERROR MESSAGES 80
-
-
- APPENDIX F: SAMPLE CONFIG.SYS FILE 83
-
-
- INDEX 87
-
-
- Chapter 1: Introduction
-
-
- Thank you for using CFG Version 2.43. CFG is a program that provides multiple
- utilities for use during CONFIG.SYS device driver installation and from the DOS
- command line and batch files. The program does not remain resident and releases
- all memory on termination. Suggestions for additions or modifications to CFG
- are welcome.
-
- CFG really is many programs combined into one. Each CFG command, or even
- subcommand, could be one entire command line utility. One of CFG's benefits is
- combining all these small utility programs into one package. Your hard disk is
- not littered with dozens or even hundreds of small, space consuming files. If
- you only use something occasionally, CFG probably has an option for it
- somewhere.
-
- Getting in touch with me is very easy. I can be contacted via CompuServe Mail
- at 73700,3344. CompuServe Mail may be accessed via the Internet using the
- address:
- 73700.3344@compuserve.com
-
- I can be reached via Prodigy Mail at UserID WNBH41A. I may also be contacted
- via surface mail at the address shown on the title page.
-
- Since I am an officer in the United States Navy, I travel frequently as a part
- of my job. I carry my portable computer and access CompuServe when possible, so
- your inquiries will be answered quickly. I currently have a job ashore and am
- readily accessible. The only time things may be delayed is when I am at sea.
-
-
-
- 1.1 Basic Operation
-
-
- [Return]
- CFG functions similar to many of the standard utilities included with DOS. CFG
- depends on its command line being formatted in accordance with the Syntax
- section below and any additional information given for each command. CFG
- processes the command line from left to right and each command is executed in
- order. Many commands return a DOS ErrorLevel that can be used in a batch file.
- The Commands section below provides detailed information on each command and its
- options.
-
-
-
- 1.2 System Requirements
-
-
- [Return]
- CFG requires an IBM compatible computer with approximately 160 kilobytes of free
- low memory to run. Most commands require DOS Version 3.0 or later. If a
- command requires a later version of DOS, it is specifically noted in its
- description in the Commands section below. The CFG screen browser will work
- with all standard video display systems: MDA, CGA, EGA, VGA and SVGA.
-
-
-
- 1.3 Disk Files Included with CFG
-
-
- [Return]
- Files Included with CFG
- File Name File Description
- ---------------------------------------------
- CFG.COM Main executable file
- CFG.HLP Short description help file
- CFG.DOC Main documentation and long description help file (ASCII)
- CFG.WW6 WinWord 6 version of CFG.DOC (registered version only)
- CFG.REG Shareware registration order form
- CFG.NEW Info on changes/bug fixes since the last major version
- INSTALL.BAT Installation batch file for CFG
- CFG.INS INSTALL.BAT renamed in the installation directory
- README.CFG CFG read me file
- FILE_ID.DIZ Program identification file for BBS SYSOPs
-
-
-
- 1.4 Documentation
-
-
- [Return]
- I maintain the main documentation file for CFG in Microsoft Word for Windows
- 6.0c. This file includes color, special formatting, hypertext DocCruiser jumps
- and special performance macros. You get the most recent version of this WinWord
- file on disk as a registered user.
-
- The printed version of this file provided to registered users is made by running
- this file through the Two by Four (2x4) printing macro that is part of Woody's
- Office POWER Pack (WOPR). The result is a fully formatted and easy-to-read
- booklet, giving you an excellent reference to the complexities and many commands
- included with CFG. Here are some special features of the electronic version:
-
- * Cruising around this WinWord file is very easy. All CommandNames are
- referenced jumps and will take you to the command definition section.
- This is a useful way to get to a specific command from Appendix C Revision
- or from a cross-reference under another command.
- * A custom toolbar gives you rapid access to the CFG DocCruiser macro. The
- macro provides a dialog box that allows you to choose exactly where you
- want to jump around in the document. Don't worry. Your regular toolbar
- will reappear when you close this file.
- * To improve readability, several choices available under the WinWord Tools
- Options View tab are reset. These changes are reset once you exit the
- file.
- * Each command section has some numbers to the right of the command line
- definition that are also jumps. The numbers refer to the version of CFG
- that the individual command was first added or subsequently changed.
- Double clicking these jump numbers will take you to the applicable version
- history section.
- * Each short command description line has a red "[Return]" jump button at its
- end. If you used a DocCruiser jump to get there, double clicking on the
- red "[Return]" button will take you back to where you came from.
- * Double clicking on a page number in the Table of Contents will take you to
- that page.
- * While this document is loaded in WinWord, some keyboard reassignments are
- temporarily made. The following table lists these:
-
- Alt + Ctrl + G Executes the CFG DocCruiser macro.
-
- Text colors in this document are used as follows:
- * Blue is used for notes, warnings, cautions and other information that needs
- to stand out. There should be some other material nearby in the file
- which is also highlighted.
- * Green is used to highlight anything involving the CFG command line or its
- parameters.
- * Red indicates a jump button. Double clicking on the red text will take you
- to the indicated subject.
-
-
-
- 1.5 Acknowledgments
-
-
- [Return]
- CFG is written entirely in assembly language and compiled using the Microsoft
- Macro Assembler Version 6.11c. There are no external code libraries involved.
-
- CFG was initially inspired by Michael Mefford's BatchMan utility. BatchMan only
- works from the command line or batch files and does not have all that many
- options. Unfortunately, that is not quite what I wanted...
-
- My thanks to:
- * Woody Leonhard for WOPR 6 [Woody's Office POWER Pack 6.0c]. It is an
- outstanding addition to WinWord. Woody's DocCruiser extra, that also
- originated with WOPR, makes life *so* much easier...
- * Eileen Wharmby for her authoring of and help with WOPR 2x4. Some times a
- document stresses macro programs in just such a way....
- * Ed Ruth for testing, suggestions and endurance Beyond the Call of Duty.
- * Rod Pullman for his DEVICE.COM utility that was essential for testing of
- CFG versions 1.0 and 1.1.
- * Sande Nissen for her excellent suggestions.
- * ... and the many others whose comments have helped make CFG a better
- program!
-
-
- Chapter 2: Registration - Why and How
-
-
-
-
-
- 2.1 Definition of Shareware
-
-
- [Return]
- Shareware distribution gives users a chance to try software before buying it.
- If you try a Shareware program and continue using it, you are expected to
- register. Individual programs differ on details -- some request registration
- while others require it, some specify a maximum trial period. With
- registration, you get anything from the simple right to continue using the
- software to an updated program with printed manual.
-
- Copyright laws apply to both Shareware and commercial software, and the
- copyright holder retains all rights, with a few specific exceptions as stated
- below. Shareware authors are accomplished programmers, just like commercial
- authors, and the programs are of comparable quality. The main difference is in
- the method of distribution. The author specifically grants the right to copy
- and distribute the software, either to all and sundry, or to a specific group.
- For example, some authors require written permission before a commercial disk
- vendor may copy their Shareware.
-
- Shareware is a distribution method, not a type of software. You should find
- software that suits your needs and pocketbook, whether it's commercial or
- Shareware. The Shareware system makes fitting your needs easier, because you
- can try before you buy. And because the overhead is low, prices are low also.
- Shareware has the ultimate money-back guarantee -- if you do not use the
- product, you do not pay for it.
-
-
-
- 2.2 Disclaimer - Agreement
-
-
- [Return]
- Users of CFG must accept this disclaimer of warranty: "CFG is supplied as is.
- The author disclaims all warranties, expressed or implied, including, without
- limitation, the warranties of merchantability and of fitness for any purpose.
- The author assumes no liability for damages, direct or consequential, which may
- result from the use of CFG."
-
- CFG is a "shareware program" and is provided at no charge to the user for
- evaluation. Feel free to share it with your friends, but please do not give it
- away altered or as part of another system. The essence of "user-supported"
- software is to provide personal computer users with quality software without
- high prices, and yet to provide incentive for programmers to continue to develop
- new products.
-
- If you find CFG is useful and that you are using it regularly after a reasonable
- trial period, you must make a registration payment of $25 to Special
- Enhancements. The $25 registration fee will license one copy for use on any one
- computer at any one time. There is a $5 shipping and handling fee for orders
- outside the United States. You must treat this software just like a book. An
- example is that this software may be used by any number of people and may be
- freely moved from one computer location to another, so long as there is no
- possibility of it being used at one location while it is being used at another.
- Just as a book cannot be read by two different persons at the same time.
-
- Commercial users of CFG must register and pay for their copies of CFG within 30
- days of first use or their license is withdrawn. Site-License arrangements may
- be made by contacting Special Enhancements.
-
- Anyone distributing CFG for any kind of remuneration must first contact Special
- Enhancements at the address below for authorization. This authorization will be
- automatically granted to distributors recognized by the Association of Shareware
- Professionals (ASP) as adhering to its guidelines for shareware distributors,
- and such distributors may begin offering CFG immediately. (However Special
- Enhancements must still be advised so that the distributor can be kept
- up-to-date with the latest version of CFG.)
-
- You are encouraged to pass a copy of CFG along to your friends for evaluation.
- Please encourage them to register their copy if they find that they can use it.
- All registered users receive a copy of the latest version of CFG.
-
-
-
- 2.3 What You Get
-
-
- [Return]
- The registration fee is paid once and gives you the right to use all future
- versions. You get a disk and laser-printed user guide, and are notified
- whenever a major revision is released. Also on the disk is a Microsoft Word for
- Windows 6.0 version of this documentation that includes color, special
- formatting and hypertext-like jumps for cruising around easily. Upgrades are
- free for the download, but I will ship a new disk and printed documentation to
- registered users for $10 at your request. There is a $5 shipping and handling
- fee for orders outside the United States. Just send a message via CompuServe
- Mail, and I will ship the order and invoice.
-
-
-
- 2.4 How To Register
-
-
- [Return]
- There are two ways to register CFG. The file CFG.REG is an order form. Please
- print it and send the form with payment to:
-
- Special Enhancements
- Mark Treadwell
- 4 Mumford Avenue
- Newport, RI 02840-1719
- USA
-
- Another way to register is via CompuServe's on-line SWREG service. SWREG is a
- CompuServe service that easily allows you to register Shareware. The price of
- the program is charged to your CompuServe account. To register CFG through
- SWREG:
-
- * Run your communications program to logon to CompuServe interactively.
- * Type "GO SWREG" [Enter] to get the SWREG menu and follow the menus to
- register CFG. When prompted for the program identification, type 3508,
- which is CFG's identification number. You'll receive the CFG package in a
- few days. The program will be on a double-sided, 3.5 inch diskette. If
- you prefer a 5.25 inch diskette, just send me a note via CompuServe Mail
- [73700,3344].
-
- If you have any enhancements, problems, suggestions, comments or complaints,
- please send them to me via CompuServe Mail or a written letter to the above
- address. Even if you have not decided to keep CFG, feel free to get in touch
- with me. I generally reply within 48 hours. Send via CompuServe Mail to Mark
- Treadwell 73700,3344.
-
-
- Chapter 3: Installation
-
-
-
-
-
- 3.1 Procedure
-
-
- [Return]
- Installation is very easy. Extract the files from the compressed archive into
- the desired disk subdirectory. Alternately, extract them onto a floppy disk and
- run the included INSTALL.BAT file. The necessary files will be copied to the
- drive and directory you specify. I recommend installing to your DOS directory
- or a general utility directory that is specified in your DOS PATH statement.
-
-
-
- 3.2 Locations
-
-
- [Return]
- The absolute minimum files for full operation are CFG.COM, CFG.HLP and CFG.DOC.
- CFG.COM expects to find CFG.HLP and CFG.DOC in the same directory that it was
- executed from. If you do not execute a Help command, only CFG.COM itself is
- required. If the installation directory is specified in your DOS PATH, you are
- not required to specify the full drive and directory when executing CFG, just
- like any other command.
-
-
-
- 3.3 Quick Help
-
-
- [Return]
- "CFG /?" gets you a syntax description and a summary of commands in a scrollable
- window. "CFG Help CommandName" gets you this file opened to the appropriate
- CommandName entry in a scrollable window.
-
-
- Chapter 4: Use
-
-
-
-
-
- 4.1 Command Line Syntax
-
-
- [Return]
- From CONFIG.SYS:
-
- DEVICE=[d:][path]Cfg.Com CommandName [Options] [;CommandName [Options]
- [; ... ]]
-
- From the DOS command line or batch file:
-
- [d:][path]Cfg CommandName [Options] [;CommandName [Options] [; ... ]]
-
- Parameters:
-
- [d:][path]
- Specifies the location of the CFG.COM file.
-
- CommandName
- The valid CommandNames are given below. The CommandNames must be fully
- spelled out exactly as shown.
-
- [Options]
- CommandName related options and SubCommandNames are detailed below for
- each command. SubCommandNames may be abbreviated as desired, but must
- remain unique from each other to be parsed correctly.
-
-
-
- 4.2 Global Switches
-
-
- [Return]
- Global Switch Descriptions
- Switch Description
- ---------------------------------------------
- /Bn Base Switch: Selects the number base to use. Some commands
- specifically require decimal or hexadecimal input. The
- default number system is base 10. The "n" specifies the
- _decimal_ number representing the new number base. Valid
- values for "n" are between 2 and 16. (Example: /B16)
- /Dn Divisor Switch: Selects an optional block size for ErrorLevel
- reporting of
- commands. The default block size is 1 unless a different
- default is given in the specific command section. This allows
- returning a valid ErrorLevel for a value that is greater than
- 255. The "n" specifies the decimal number by which the result
- is divided. Valid values for "n" range from 1 to 65535.
- (Example: /D8192)
- /E[+][@][!][E] ErrorLevel Switch: The "+" option will display extended
- ErrorLevel
- information including the command and subcommand being
- executed. The "@" option places the output ErrorLevel in the
- environment variable "EL". By default, this will be in the
- master environment. Use the /2 switch to place it in the
- environment of a secondary command processor. Use the "!"
- option to specify which of the possible ErrorLevels to return
- in MultiCommand. Use the "E" option with "@" if you want the
- basic ErrorLevel displayed with environment output. The order
- of the options does not matter. See the Return section below
- for more explanation.
- /Q Quiet Switch: Commands will not display character output if
- this is used.
- This switch may be used with the /@EnVar switch, but has no
- effect on the /E and /E+ switch output or error output.
- /1[A|B] Environment Switch, Primary or Master: Instructs CFG to
- search for and
- update the environment of the primary command processor. This
- is the default. See the DOS section for an explanation of the
- "A" and "B" options for this switch and a discussion of
- environments in general.
- /2 Environment Switch, Secondary or Parent: Instructs CFG to
- search for and
- update the environment of a secondary command processor. Use
- this switch if you think your batch file will be run under
- Windows. Under Windows 95, there is only one environment, so
- the /1 and /2 switches have identical output. See the DOS
- section for a discussion of environments in general.
- /@[=]EnVar Environment Output Switch: Place ASCII command result in the
- DOS variable "EnVar". No spaces are allowed between the "@",
- the "=" (if used) and the environment variable name. The
- rules for environment variables are the same as for the DOS
- SET command except that mixed case is permitted for the
- variable name by default. The "=" option forces CFG to
- capitalize "EnVar" to ensure compatibility with the DOS SET
- command. See the DOS section for further details. Each
- command that supports this switch is indicated below. The
- variable name should be followed by at least one space to
- prevent following command line text from being included in the
- name.
- /, Comma Switch: Insert commas every three places in decimal
- numbers
- displayed on the screen.
- /? Help Switch: Display an abbreviated command summary.
- Available from
- command line only. Not available in MultiCommand.
-
- See the individual commands for additional switches.
-
-
-
- 4.3 Switch Usage
-
-
- [Return]
- The command line is scanned for any switches before CommandName parsing. If a
- valid switch is found, a program variable is set and the switch is blanked from
- the command line by replacing it with spaces. This includes text and numbers
- appearing after the /@, /B, /D and /E switches. A switch may be placed anywhere
- on the command line and still be found. Switches will not be found in
- _*quoted*_ text strings (such as in Cecho, Echo and EchoPause) as long as there
- are closing quotes. Note that _*all*_ possible switches are scanned for each
- command since CFG does not know the CommandName when switch parsing occurs.
-
- If you use the MultiCommand syntax, the switches are scanned only between the
- MultiCommand separators. This allows each individual command on the command
- line to have its own different set of switches.
-
- If both the /1 and /2 switches are used, CFG will update both the master and
- parent environments. If the two refer to the same segment, CFG will only update
- it once. If both are used with an Env command information subcommand, master
- environment data is returned. See the DOS section for the gory details. If the
- switches are used singly, only the designated environment is updated.
-
-
-
- 4.4 MultiCommand Mode
-
-
- [Return]
- CFG's MultiCommand mode allows more than one CommandName on the command line.
- The standard separator between commands is the semi-colon. CFG treats each
- section in MultiCommand mode completely independent of any other.
-
- All switches and variables are reset, but environment changes are cumulative.
- It is just like running the program again. See the Sample section for examples.
- Help is not available in MultiCommand mode.
-
- Be aware that DOS will strip semi-colons from passed parameters (%1, %2, etc.)
- in a batch file if that is how you build CFG's command line. DOS does this
- because it treats a semi-colon as white space.
-
-
-
- 4.5 Number Base
-
-
- [Return]
- The /Bn switch allows you to specify the number base used by CFG. All
- subsequent number input and output for that command is with the specified base.
- If the value of "n" is not between 2 and 16, the switch is ignored without an
- error message. In this case, the default base 10 is used. The command must
- specifically support this switch for it to be in effect. No error is generated
- if the switch is present for a command that does not support it (it is just
- ignored).
-
-
-
- 4.6 Return ErrorLevel
-
-
- [Return]
- Generally, the exit ErrorLevel is 0 for off/invalid/disabled/etc. and 1 for
- on/valid/enabled/etc. Specific values are given for each command. An
- ErrorLevel of 255 or similar high number generally indicates that an error
- occurred. Commands with no particular exit ErrorLevel will always return 0. A
- decimal output of the number may be placed in the environment variable "EL" if
- the /E@ switch is used.
-
- To amplify the Global section description:
- * /E displays the basic ErrorLevel as a decimal number.
- * /E+ displays the ErrorLevel with the CommandName and SubCommandName.
- * /E@ places the ErrorLevel in the environment variable "EL". It will not
- display the basic ErrorLevel.
- * /EE@ (or /E@E) displays the basic ErrorLevel with environment output also.
- * The "+" option overrides the "E" option if both are used.
- * A "!" may be used in conjunction with any of these to tell CFG which
- ErrorLevel of a MultiCommand command line to return.
- * Clear as mud?
-
-
-
- 4.7 Messages
-
-
- [Return]
- CFG's information messages contain the following elements:
- * Program name
- * Program version
- * CommandName
- * SubCommandName (if applicable)
- * Command number (for a MultiCommand command line)
- * Error warning (if an error occurred)
- * Message text
- * ErrorLevel (for error messages)
-
- CFG provides numerous error messages to make problems easier to diagnose and
- correct. This is useful in CONFIG.SYS since rebooting multiple times to get
- things right can be tedious. ErrorLevel reporting is available from both
- CONFIG.SYS and the command line although it can only be acted on from a batch
- file.
-
-
-
- 4.8 Notes
-
-
-
- The following general notes pertain to many aspects program operation.
-
-
- 4.8.1 Usage From CONFIG.SYS and the Command Line
-
- [Return]
- CFG is a dual-mode program that will run both as a non-resident device driver
- from CONFIG.SYS and as a command line/batch file utility. The title line of
- each command below specifies whether it can be used from CONFIG.SYS, from a
- BATCH file (command line) or from both.
-
- The standard requirements for running CONFIG.SYS device drivers apply. Section
- 4.1 Commandabove gives you the details. Briefly, each line begins with
- "Device=" to tell the DOS system initialization routine to load a device driver.
- This is followed by the full Path to the CFG executable. This is required since
- DOS has not yet read the Path statement in your AUTOEXEC.BAT file. Next comes
- the CFG executable name and the command line parameters you desire. DOS handles
- the Device= line to the left of CFG's name, CFG handles the rest.
-
- CFG is compatible with other device drivers and may be executed as many times as
- desired. I personally place a KeyPause command after every device driver
- installation line to allow me to pause the display.
-
-
- 4.8.2 On Loading High
-
- [Return]
- Do *NOT* try to load CFG into an Upper Memory Block. Since unpredictable errors
- may occur, CFG determines its load location at program start. If CFG is running
- above the 640KB boundary, it terminates immediately with the error"Unable to run
- in upper memory."
-
- This error is normal. To correct it in CONFIG.SYS, remove the "DeviceHigh" from
- the start of the CFG command line and substitute "Device." From a batch file,
- remove the "LoadHigh" or "LH" from the start of the CFG command line and run the
- program normally. Running high is not allowed for your sanity.
-
-
- 4.8.3 Case on the Command Line
-
- [Return]
- Case does not matter in CONFIG.SYS since DOS capitalizes everything in the file
- during its parsing scans. Using mixed case in your CONFIG.SYS file may actually
- make things easier to read and understand. See the Sample section below for an
- example. This shift to all upper case is pertinent when using the Cecho, Echo
- or EchoPause commands in CONFIG.SYS. I provide a toggle to shift the echoed
- line to/from lower case to enhance readability.
-
- CFG does the same shift internally when parsing the command line, so you may use
- any mixture of case you desire on the CFG input line.
-
-
- 4.8.4 DOS Environment
-
- [Return]
- The DOS command interpreter COMMAND.COM maintains an area of memory called the
- environment in which it stores specially formatted information that is globally
- available to all programs and batch files. The environment block contains a
- list of ASCIIZ strings (strings of ASCII characters, each terminated by a zero
- byte) that store various information. You may view the contents of the
- environment by typing "SET" at the command line prompt.
-
- The DOS environment size for the resident command processor is specified with
- the SHELL command in CONFIG.SYS. The COMMAND.COM /E:nnnnn switch specifies the
- environment size, where "nnnnn" must be in the range 160 through 32768. DOS
- rounds this number up to a multiple of 16 bytes. If "nnnnn" is less than 160 or
- greater than 32768, DOS uses the default size of 256 bytes and displays a
- "Parameter value not in allowed range" error (actually just a warning). The
- environment size can only be changed by editing CONFIG.SYS and rebooting the
- system under most circumstances. See the Sample section below for an example
- SHELL line.
-
- Each environment string is of the form "NAME=value", where NAME is capitalized
- and may be of reasonable length and "value" can be almost anything. The only
- thing that cannot be in an environment string is an equals sign (since it
- separates the NAME and "value") and a zero byte (since it is the string
- terminator).
-
- The environment is accessible via the DOS SET command. DOS automatically
- capitalizes all NAME variables. The CFG Env Set command and /@EnVar switch will
- allow you to specify exactly the case of the NAME. See below how you can change
- this behavior. Environment variables with lower case letters may be displayed
- by the DOS SET command, but they cannot be changed.
-
- Each program receives a copy of the DOS environment for its local use on
- execution. The size of this local environment is always rounded up to the next
- largest number divisible by 16 based on the total length of strings currently in
- the environment. This is due to the way DOS allocates blocks of memory in
- paragraph (16 byte) amounts. This leaves little or no room for further
- expansion and storage.
-
- CFG manipulates the DOS environment(s) directly. I normally dislike doing stuff
- like this, but it ended up being just too useful an ability to pass up. CFG
- output is _much_ easier to use by stuffing it into the environment and allowing
- DOS to do the string manipulations and concatenations. Note that a batch file
- line that invokes environment variables will be processed by DOS using the
- active environment -- CFG will never know environment variables were involved
- (and for my sanity, I do not want to know!).
-
- Note that DOS will automatically extend the size of the active environment if it
- is adjacent to a free memory block and environment variables are entered from
- the command line. As soon as a batch file or a program is loaded into memory,
- the size of the environment is constrained. In the case of a secondary command
- processor, it will be cut off at the start of the next paragraph of memory.
- This is what causes the environment of a secondary command processor to only
- have between 0 and 15 bytes of free space.
-
- There are several methods to locate the master environment. The pros and cons
- of each method are discussed in detail in Andrew Schulman's (et al) excellent
- book _Undocumented DOS_ (Second Edition) [highly recommended!]. I refer you
- there for the detailed discussion. Suffice it to say that the first method I
- used to locate the environment was to walk the chain of Memory Control Blocks to
- locate COMMAND.COM.
-
- I had a problem with assumptions when I ran into 386^Max version 7 and its
- DOSMAX utility, which can load the COMMAND.COM stub into a UMB. I (and many
- others) had never expected this (silly us), so the routine failed.
-
- I fixed this by linking in the UMB memory chain. This, however, assumes that
- the memory manager involved supports the standard DOS UMB link and strategy
- commands. Due to the possibility of faking this test out, it is now the
- secondary option available via the /1B switch. The new default method uses the
- DOS Interrupt 1EH vector. This method is available via the /1 or /1A switch.
- Normally, you need just specify /1 on the command line for the master
- environment. Neither /1 or /2 is required unless you need to specify the
- specific environment. Even this method is not infallible if you are playing
- around with some resident debuggers.
-
- As a side note to all of this, PC Magazine published a DOS Debug script in their
- January 25, 1994 issue that created UMB.COM. This small utility changed the DOS
- memory strategy at the end of CONFIG.SYS execution so that the UMB area was the
- preferred load location when COMMAND.COM was initially executed and going
- resident. As you may expect, the master environment followed it into a UMB and
- CFG had a problem again. This one is also fixed by the changes noted above.
-
- Windows 95 changes everything. Under Windows 95, there is only one environment
- in a DOS window, so the /1 and /2 switches have identical output. A standard
- DOS box behaves the same as running straight DOS did previously.
-
- Several people asked to change the default CFG uses for /@EnVar to always
- capitalizing the "EnVar". I did not because that may break systems that depend
- on this behavior. Changing the default would change the way batch files are
- processed. I added the "=" option to /@ to give CFG this ability without
- changing the default. Since "=" cannot be in an environment name or value, it
- is perfect for this application.
-
-
- 4.8.5 Undocumented DOS
-
- [Return]
- An unfortunate fact of life is that documentation is often terrible. [NOTE:
- This does _*not*_ apply to me since I try to believe that *my* documentation is
- superb. <VBG!>]
-
- One of the things the Microsoft does not document, but many people use, is a
- special DOS data area. The data area goes by several popular names: List of
- Lists, SysVars, SysInitVars. Whatever you call it, DOS cannot exist without
- this group of variables. Neither can CFG.
-
- I note in each section of this file if the particular command uses undocumented
- information. In most cases, this use of undocumented DOS starts with that
- special DOS data area. This is a relatively minor use of undocumented DOS, as
- such things go, but I feel compelled to admit its use since I am providing a
- general utility program that is intended to be reliable under all versions of MS-
- DOS. [Note that I say _MS-DOS_. Please do not hold me responsible for
- DR/Novell/PC DOS or 4DOS/NDOS.]
-
- Andrew Schulman is the master of undocumented DOS. That said, I recommend
- Andrew's _Undocumented DOS_, Second Edition as a basic source for an explanation
- of undocumented DOS calls and behavior. There are several other texts that also
- pertain and are listed in the Bibliography section. I recommend all of them as
- a basic reference library if you are trying to program for DOS. You can
- certainly accomplish much using only documented functions, but the use of
- undocumented functions and data structures is the only way to accomplish some
- tasks. Witness some of the functions that CFG provides.
-
- If you have any undocumented DOS questions, I will be happy to answer them.
- Alternatively, I recommend the "Undocumented Corner" (Section 4) of the Doctor
- Dobbs Journal Forum on CompuServe (GO CIS:DDJFORUM) as the ultimate source.
- Andrew Schulman, Jim Kyle, Geoff Chappell, Max Pietrek and many other notables
- of undocumented programming hang out there (I lurk, I do not consider myself a
- notable).
-
-
- Chapter 5: Commands
-
-
- The commands below are generally in alphabetical order except for those which
- are closely related by function. The leading "###" for each command is required
- for the search engine in the CFG Help command.
-
- All command line formats and examples given below should be understood to begin
- with "Device=[d:][path]Cfg.Com " in the CONFIG.SYS file or "[d:][path]Cfg " from
- the command line unless specified otherwise.
-
-
- *### Add ### Sub ### Mul ### Div ### Mod [BATCH]
- **### And ### Xor ### Not ### Or**
- *
- Perform various arithmetic operations on the arguments. [Return]
-
- Add [/@EnVar] [/Q] [/Bn] a b c ... 2.3 2.4
- Sub [/@EnVar] [/Q] [/Bn] a b c ... 2.3 2.4
- Mul [/@EnVar] [/Q] [/Bn] a b c ... 2.3 2.4
- Div [/@EnVar] [/Q] [/Bn] a b 2.3 2.4
- Mod [/@EnVar] [/Q] [/Bn] a b 2.3 2.4
-
- And [/@EnVar] [/Q] [/Bn] a b 2.3 2.4
- Or [/@EnVar] [/Q] [/Bn] a b 2.3 2.4
- Xor [/@EnVar] [/Q] [/Bn] a b 2.3 2.4
- Not [/@EnVar] [/Q] [/Bn] a 2.3 2.4
-
- CFG performs internal 64-bit arithmetic and returns a 32-bit result. With this
- accuracy, the largest number CFG can handle is 2^^32-1, or 4,294,967,295. This
- should be adequate for most purposes. CFG performs unsigned operations so all
- values must be positive. All commands support the /Bn Base switch. Also see
- the Convert command for converting numbers between number bases.
-
- * Add - Sums the numbers on the command line. An overflow error is generated
- if the result exceeds the 32-bit limit given above.
- * Sub - Subtracts the number "b", "c", etc. from "a". An underflow error is
- generated if the result goes negative.
- * Mul - Multiplies the numbers on the command line. An overflow error is
- generated if the result exceeds the 32-bit limit given above.
- * Div - Divides "a" by "b" and returns the quotient. A divide by zero error
- is generated if the divisor "b" is zero.
- * Mod - Divides "a" by "b" and returns the remainder. A divide by zero error
- is generated if the divisor "b" is zero.
- * And - Performs a bitwise AND of "a" and "b".
- * Or - Performs a bitwise OR of "a" and "b".
- * Xor - Performs a bitwise exclusive OR of "a" and "b".
- * Not - Takes the inverse of "a".
-
-
- *### ANSI [CONFIG/BATCH]
- *
- Determine if the ANSI driver is loaded in memory. [Return]
-
- ANSI 2.0 2.1
-
- ANSI Exit ErrorLevels
- ---------------------------------------------
- 0 ANSI is not installed
- 1 ANSI is installed
-
- Determines if any ANSI driver is installed by writing an ANSI cursor positioning
- string to the screen.
-
-
- *### ASCII [BATCH]
- *
- Read input numbers and write the corresponding ASCII characters. [Return]
-
- ASCII [/Bn] a b c ... 2.0 2.3
-
- where "a b c ..." represent numbers. The command reads the numbers and writes
- the corresponding ASCII characters to DOS StdOut, allowing the output to be
- redirected as desired. This is a very useful way of creating short temporary
- files or sending printer control characters. The quantity of input numbers is
- limited only by DOS command line length. The /Bn Base switch specifies the
- number base to be used for command line numbers. The /Q switch has no affect on
- this command. Numbers greater than 255 are ignored.
-
- Example command use:
-
- Cfg RandomFile /@RETURN %TEMP%
- Cfg ASCII 64 67 68 32 > %TEMP%\%RETURN%.BAT
- CD >> %TEMP%\%RETURN%.BAT
-
- This example creates a unique random file name in the system TEMP directory,
- writes "@CD " to the temporary batch file and adds the current directory.
- Executing %TEMP%\%RETURN%.BAT will return you to the current directory.
-
-
- *### Batch
-
- **[BATCH]**
- *
- Return information concerning the currently running batch file. [Return]
-
- Batch SubCommandName [/Q] [/@EnVar] 2.42
-
- NOTE: Uses undocumented information.
-
- The following are valid SubCommandNames: Call, Command, Drive, FullName, Name,
- Params, Path, Reset. Each SubCommandName may be abbreviated as desired. All
- returned strings are in capitals, except for the Params SubCommand, which
- returns the 1-25 parameters with the case as entered. Place the result of
- individual string commands into the desired environment using the /@EnVar
- switch. This command displays the output strings by default. Suppress this
- display with the /Q Quiet switch. An error message is generated if this command
- is run from the command line vice a batch file. This command requires DOS
- Version 3.3 or higher.
-
- * Call: Determines if the batch file was executed from the command line or
- was CALL-ed from another batch file. If the currently running batch file
- was started without a CALL from another batch file, it completely replaces
- the previously running batch file, although prior CALL-s remain in effect.
- There is no way to tell if this happened without reading through the batch
- file itself.
-
- Batch Call Exit ErrorLevels
- ---------------------------------------------
- 0 Top level batch file. It has not been CALL-ed.
- Else Nesting level of the CALL-s.
-
- * Command: Returns the full string used to launch the running batch file
- from either the command line or a CALL-ing batch file. This may be almost
- anything. It may be as simple as just the name. It may include the .BAT
- ending. It may have a full or partial path specification. It also
- includes any command line parameters that were passed (input prior to any
- SHIFT commands). Note that DOS strips out "white space", so what you get
- back is without the extra spaces, equal signs, semi-colons, etc.
- * Drive: The drive the batch file is executing from. This returned in the
- form "d:".
- * FullName: The fully-qualified file name used to execute the batch file.
- This includes the drive letter, full path and file name with .BAT ending.
- * Name: The name of the executing batch file. The name includes the .BAT
- ending.
- * Params [/1 | /2]: An extremely useful command if you need to access more
- than nine command line parameters at the same time. Does not require the
- use of the DOS SHIFT command. This option takes the command line
- parameters for the currently running batch file and places them into
- environment variables with names "0" through "25". Any previously
- existing values are deleted. Thus, using %0%, %1%, %2%, ..., %25% instead
- of the regular %0, %1, %2, ..., %9 will give you access to up to 26
- command line parameters vice the normal DOS maximum of 10. You should
- expressly specify which environment you want the variables created in,
- although the command defaults to the master environment. The /@EnVar
- switch is ignored by this command. Run the Reset SubCommand to clean up.
- (There is no programming reason that limits CFG to 0-25. It just seemed
- like a reasonable number.)
- * Path: The drive letter and full path of the executing batch file without
- the trailing "\" or the Name.
- * Reset: Removes the environment strings created by the Params SubCommand.
- These strings may also be removed using DOS SET commands. This command
- searches for the "0" variable and deletes all further _sequential_
- variables it finds. The /@EnVar switch has no meaning for this command.
-
-
- *### Beep [CONFIG/BATCH]
- *
- Beep the speaker. [Return]
-
- Beep [m n [, m n] ... ] [/Bn] [/N] 1.0 2.0 2.2
-
- where "m" corresponds to a frequency in Hertz and "n" corresponds to the number
- of 1/18 second increments that comprise the duration. The /N switch tells CFG
- to not flush the keyboard buffer prior to executing the command. If nothing is
- specified, the default sound is a C note for 1/6 of a second (1046,3). By
- separating the argument pairs with commas, a series of tones may be produced
- with the same command. Pressing any key while playing ends the command. Commas
- are strictly interpreted as separators.
-
-
- *### Blink [CONFIG/BATCH]
- *
- Enable blinking screen characters. [Return]
-
- Blink 2.0 2.3
-
- Calls Interrupt 10H Function 10H Subfunction 3 to enable blinking characters on
- EGA and above. Any characters with intense backgrounds will start blinking.
-
-
- *### Boot [CONFIG]
- *
- Modify CONFIG.SYS in memory during execution. [Return]
-
- Boot SubCommandName 2.2
-
- NOTE: Uses undocumented information.
-
- The following are valid SubCommandNames: NoError. Each SubCommandName may be
- abbreviated as desired. Error messages are displayed if the routine fails.
-
- * NoError: Scans the tokenized CONFIG.SYS file in memory and changes any
- lines which will display an "Unknown command" error to a Remark. This
- effectively hides errors from the DOS parser. This option currently works
- under DOS version 5.0 only. It will report the number of errors which it
- cleared. It is important to note that this only works on DEVICE
- statements in CONFIG.SYS since general parameters (such as FILES, BUFFERS
- or SHELL) are evaluated prior to loading device drivers.
-
-
- *### Border [CONFIG/BATCH]
- *
- Set the screen border color. [Return]
-
- Border [Color] 2.0
-
- The notes on colors for the Cls command apply to the Border command except as
- noted here.
-
- If no color is given or an invalid color is specified, the current screen
- background color at the cursor location is used. If anything appears after the
- CommandName that cannot be parsed as a color, an error message is displayed.
-
-
- *### Break [BATCH]
- *
- Determine status of DOS extended Break checking. [Return]
-
- Break 2.0
-
- Break Exit ErrorLevels
- ---------------------------------------------
- 0 Break is off
- 1 Break is on
-
-
- *### CanCopy [BATCH]
- *
- Determine if there is enough room to copy files to a disk. [Return]
-
- CanCopy FileSpec [d:] 2.0
-
- CanCopy Exit ErrorLevels
- ---------------------------------------------
- 0 No room to copy files or DOS file error
- 1 Room to copy files
-
- where FileSpec can use any DOS wildcards and "d:" corresponds to a valid DOS
- drive. If "d:" is omitted, the default drive is used. The FileSpec search is
- not recursive. It will examine only the directory specified.
-
-
- *### Cecho [CONFIG/BATCH]
- *
- Echo text to the screen with the specified colors. [Return]
-
- Cecho [/I | /K] [/C | /N] "Fore [on] Back" String 2.0 2.1 2.3 2.4
-
- The desired screen color for String must be enclosed in double quotes. The
- notes for the Cls command use of colors apply. The /C switch is used to output
- a carriage return only at the end of the String, returning the cursor to the
- first column for overwriting the previous output. The /I switch calls the
- Intense command to enable intense backgrounds on EGA and above. The /K switch
- calls the Blink command to enable blinking characters on EGA and above. The /N
- switch is used to eliminate the final carriage return/line feed, leaving the
- cursor at the end of the String just displayed. /I takes precedence over /K and
- /N takes precedence over /C if all are included.
-
- The displayed String starts with the first character after the closing double
- quote of the color, leading spaces are included. The Echo command line format
- applies to the String. The /Q switch has no affect on this command.
-
-
- *### Cls [CONFIG/BATCH]
- *
- Clear the screen with a choice of foreground and background colors. [Return]
-
- Cls [Foreground [on] Background] 1.0 1.1 2.0
-
- Cls Colors
- ---------------------------------------------
- Black Gray
- Blue Bright Blue
- Green Bright Green
- Cyan Bright Cyan
- Red Bright Red
- Magenta Bright Magenta
- Yellow Bright Yellow
- White Bright White
-
- If any bright color in the right column is chosen for a background, the video
- display is reprogrammed to show intense background colors vice blinking text.
- Programs may reset this, causing all text on the screen to start blinking.
-
- If ANSI is not installed, the screen is cleared using a BIOS window scroll. The
- screen colors may not remain permanent depending on the behavior of the video
- adapter. If ANSI is installed before CFG is run, CFG will detect it and use
- ANSI escape sequences to change system colors.
-
- If no colors are given or if an invalid combination is used, the current screen
- colors at the cursor location are used. If anything appears after the
- CommandName that cannot be parsed as a color, an error message is displayed with
- a three second WaitFor pause prior to continuing with the clear screen.
-
- Cls sets the screen border (overscan register) to the same color as the
- background. Use the Border command if you want to change this. It also
- restores the cursor size to what it was initially since some ANSI clear screen
- routines change the cursor size.
-
- NOTE: The "Bright ..." colors are scanned on the command line with only a
- single space between the words. Otherwise, CFG will accept any number of
- spaces between words.
-
-
- *### CodePage [BATCH]
- *
- Determine the current system code page table. [Return]
-
- CodePage [/Q] [/@EnVar] 2.2
-
- CodePage Exit ErrorLevels
- ---------------------------------------------
- 0 Code Page 437 [English-United States]
- 1 Code Page 850 [Multilingual (Latin I)]
- 2 Code Page 852 [Slavic (Latin II)]
- 3 Code Page 860 [Portugal]
- 4 Code Page 861 [Iceland]
- 5 Code Page 863 [French Canadian]
- 6 Code Page 865 [Norway/Denmark]
- 254 Unknown Code Page
- 255 Invalid DOS version
-
- The code page number is displayed. This command requires DOS version 3.3 or
- higher.
-
-
- *### ColdBoot [BATCH]
- *
- Perform equivalent of a power-on system reset. [Return]
-
- ColdBoot SubCommandName [/V] 2.0 2.1 2.3 2.32 2.42
-
- The following are valid SubCommandNames: WaitFor, WaitTo, Verify. Each
- SubCommandName may be abbreviated as desired. Error messages are displayed if
- the routine fails.
-
- All disk buffers that may not yet be written are flushed to disk via Interrupt
- 21H Function 0DH (Disk Reset) prior to system reset. EMM386 is shut down prior
- to system restart. For 8086/8088 processors only, the command jumps to
- FFFF:0000 after clearing the warm boot flag in the BIOS data area. For 80286+
- processors, the system is reset via the keyboard controller for reliability.
- The /V Verify switch is available for use with the WaitFor and WaitTo
- subcommands. Use the WarmBoot command to simulate a keyboard Ctrl-Alt-Delete
- reset.
-
- * WaitFor: Executes the WaitFor command first. All command line options of
- the WaitFor command are available.
- * WaitTo: Executes the WaitTo command first. All command line options of
- the WaitTo command are available.
- * Verify: Prompt before rebooting.
-
-
- *### Color [CONFIG/BATCH]
- *
- Set screen color for future output using ANSI escape sequences without clearing
- the screen. [Return]
-
- Color Foreground [on] Background 1.1
-
- The notes on colors for the Cls command apply to the Color command except as
- noted here.
-
- ANSI must be installed. If it is not installed, the command is aborted with an
- error message. If no colors are given or if an invalid combination is used, an
- error message is displayed.
-
- The Color command is designed to be used immediately after ANSI has been loaded
- into memory to set its default colors from gray on black to what you desire. It
- may also be used to highlight the output of a specific program or group of
- programs that do not use the BIOS for output. Note that Color will not repaint
- the screen. It only sets the color of any _future_ output made via DOS. A
- program that writes to the screen via direct BIOS calls specifies its own
- colors. Use the Cls command to reset the entire screen.
-
-
- *### Cols [BATCH]
- *
- Determine the number of displayed columns. [Return]
-
- Cols 2.0
-
- The returned ErrorLevel is based on the value stored in the BIOS data area.
-
-
- *### ComBaud [CONFIG/BATCH]
- *
- Returns the baud rate of the indicated serial port. [Return]
-
- ComBaud n [/Q] [/@EnVar] 2.4
-
- ComBaud Exit ErrorLevels
- ---------------------------------------------
- 0 Error 7 4800 baud
- 1 110 baud 8 9600 baud
- 2 150 baud 9 14,400 baud
- 3 300 baud 10 19,200 baud
- 4 600 baud 11 38,400 baud
- 5 1200 baud 12 57,600 baud
- 6 2400 baud 13 115,200 baud
-
- where "n" is the serial port to be tested. Valid numbers are 1, 2, 3 and 4. An
- error message is given if the port is missing or invalid.
-
- The exact baud rate is displayed. An intermediate rate will return the
- ErrorLevel of the faster rate.
-
-
- *### ComHide [CONFIG]
- *
- Hide and restore the serial port base addresses. [Return]
-
- ComHide SubCommandName 1.0
-
- The following are valid SubCommandNames: Hide, Restore. Each SubCommandName
- may be abbreviated as desired. Error messages are displayed if the routine
- fails.
-
- * Hide: Hides the serial port base addresses by copying them to a high
- memory location.
- * Restore: Command verifies the signature and checksum stored with the port
- addresses to ensure that they were not accidentally over-written while
- hidden. The command then copies the base addresses back to their normal
- location.
-
- The default location for the hidden data is 7001:0000 for DOS versions before
- 5.0. This is below the 512 KB boundary in the event that the machine only has
- that much base memory available, and high enough to keep it from being over-
- written during execution of other device drivers while the data is hidden. For
- DOS Version 5.0+, the location will vary depending on what the SysInit loader
- module reports as the maximum available memory in the device driver header.
- This prevents interference with the larger memory requirements in the upper
- areas around the 640 KB point that can occur under DOS 6.0+ with large multiple-
- configuration CONFIG.SYS files.
-
- Example command lines:
-
- CFG.COM ComHide Hide
- MANGLE.SYS
- CFG.COM ComHide Restore
-
-
- *### Compare [BATCH]
- *
- Compare two strings. [Return]
-
- Compare [/C] String1 String2 2.0
-
- Compare Exit ErrorLevels
- ---------------------------------------------
- 0 Strings are not the same
- 1 Strings are the same
-
- String1 and String2 must be a single group of characters, containing no
- separators. The comparison is case sensitive. The /C switch makes the
- comparison case insensitive.
-
-
- *### ComSet [BATCH/CONFIG]
- *
- Sets the serial port base addresses to a default or specified value. [Return]
-
- ComSet a [b] 2.4
-
- CAUTION: This command changes values established by the BIOS on system startup.
- Be very careful with its use.
-
- Where "a" corresponds to the desired port base address to set: 1, 2, 3 or 4.
- The "b" corresponds to an optional hexadecimal value to set the port base
- address to. No checking is performed to warn of values being overwritten.
-
- This command places a default port base address value (or the specified value)
- in the appropriate location in the low memory DOS data area. The default values
- used for the ports are 3F8H, 2F8H, 3E8H and 2E8H. If your system uses different
- values, you must specify them as "b" on the command line.
-
- You can set multiple base addresses to the same value to access the same
- physical port using different DOS port names. Note that this command does not
- address any changes with the IRQ associated with a specific hardware port.
-
-
- *### ComSwap [CONFIG/BATCH]
- *
- Swap the serial base port addresses for the two serial ports specified.
- [Return]
-
- ComSwap a b 1.0
-
- where "a" and "b" are the numbers of the serial ports to be swapped. Valid
- numbers are 1, 2, 3 and 4. An error message is given if one of the ports is
- missing or invalid.
-
- ComSwap switches the two ports as far as DOS is concerned. This is useful if
- you need to shift the port addresses around prior to loading software device
- drivers. This command may not have any effect for programs that use hard-coded
- port addresses. This command can not shift hardware IRQ values. The contents
- of the port addresses are not checked during the swap.
-
- Example command line:
-
- ComSwap 4 2
-
-
- *### Convert [BATCH]
- *
- Changes numbers between number base systems. [Return]
-
- Convert a b [/Bn] 2.3
-
- where "a" is in the base specified by the /Bn switch (or the default decimal
- system) and "b" is a decimal number specifying the base to convert "a" to.
-
-
- *### CoProc [BATCH]
- *
- Determine the Intel CoProcessor installed. [Return]
-
- CoProc [/Q] 2.0 2.2 2.3
-
- CoProc Exit ErrorLevels
- ---------------------------------------------
- 0 No coprocessor installed
- 1 8087
- 2 80287
- 3 80387DX or 80387SX
- 4 80486DX or 80487SX
- 5 Pentium
-
- This routine uses the Intel recommended techniques for properly determining what
- type of coprocessor is installed in the system. Use the CPU command to
- determine which processor is present.
-
-
- *### Country [BATCH]
- *
- Determine the country code or return country specific information. [Return]
-
- Country [n] [/Q] [/@EnVar] 2.2 2.42
-
- where "n", if present, is a decimal value between 0 and 9 that returns the
- following information:
-
- Country Exit ErrorLevels and Meanings
- n ErrorLevel String Description
- ---------------------------------------------
- None ? Decimal number Country code
- 0 0 Decimal number Date: USA, mm dd yy
- 0 1 Decimal number Date: Europe, dd mm yy
- 0 2 Decimal number Date: Japan, yy mm dd
- 1 0 Currency symbol
- 2 0 Thousands separator
- 3 0 Decimal separator
- 4 0 Date separator
- 5 0 Time separator
- 6 0 Decimal number Currency: Symbol before value
- 6 1 Decimal number Currency: Symbol follows value
- 6 2 Decimal number Currency: Symbol replaces decimal
- point
- 7 ? Decimal number Digits after currency decimal
- 8 0 Decimal number Time: 12-hour clock
- 8 1 Decimal number Time: 24-hour clock
- 9 0 Data-list separator
-
- The "n" values 1, 2, 3, 4, 5 and 9 are also valid for the Now command to include
- in its output. See the Now command for use.
-
-
- *### CPU [BATCH]
- *
- Determine the Intel microprocessor installed. [Return]
-
- CPU 2.0 2.2 2.3 2.41
-
- CPU Exit ErrorLevels
- ---------------------------------------------
- 0 8086/8088
- 1 80286
- 2 80386DX or 80386SX
- 3 80486SX
- 4 80486DX or 80487SX
- 5 Pentium
-
- This routine uses the Intel recommended techniques for properly determining what
- type of CPU is installed in the system. If an 486 class microprocessor has been
- recognized, CFG will determine if the CPU has a floating point unit (486 DX CPU,
- 487 SX MCP) or not (486 SX CPU). For Pentium processors, the vendor
- identification returned by the chip is displayed. For Intel Pentium processors,
- the stepping level, model and family numbers are also displayed.
-
- Use the CoProc command to determine which math coprocessor is present. See the
- P5 command for details on the Pentium FDIV bug and the stepping levels it is
- corrected in.
-
-
- *### Cursor [CONFIG/BATCH]
- *
- Change the size of the text mode screen cursor. [Return]
-
- Cursor {SubCommandName | a b} 2.0
-
- where "a" and "b" are decimal numbers of the start and stop screen scan lines
- for the cursor. The following are valid SubCommandNames: Default, Hide,
- Restore. Each SubCommandName may be abbreviated as desired. If the routine
- fails, error messages are displayed and the cursor size is not changed.
-
- * Default: Returns the cursor to the default values given below.
- * Hide: Sets the "invisible" bit code using Interrupt 10H Function 1.
- * Restore: Sets the "normal" bit code. Some programs may modify this on
- their own. There are known bugs in these functions in some EGA BIOS 43
- line modes.
-
- The start and stop scan lines are numbered with line 1 at the bottom and
- increasing towards the top. Using this convention, the following cursor values
- apply:
-
- Cursor Scan Line Values
- Adapter 25 Line Default 43/50 Line Default Maximum
- ---------------------------------------------
- CGA 1 2 -- 8
- EGA 2 3 2 2 1 4
- VGA+ 2 3 2 2 1 6
-
- This numbering scheme is a little more consistent than what the BIOS expects and
- lets the program calculate the values required by the BIOS. If a number greater
- than the maximum number of scan lines is entered, it is truncated to the
- maximum.
-
- Note that after a mode reset the cursor will be returned to its default size by
- the BIOS. You will need to issue the appropriate command to set it to the
- desired shape.
-
- Video adapter BIOS' implement the cursor functions differently. You may not get
- the results you expect when you specify scan lines, depending on your adapter.
- Keep trying until you end up with a shape you like.
-
- Example command lines:
-
- Cursor Hide
- Cursor 2 2
-
-
- *### Day ### WeekDay ### Month [BATCH]
- **### Year ### FullYear ### AM ### PM**
- **### Hour ### Minute ### Second**
- *
- Determine the return value for the appropriate time/date command. [Return]
-
- CommandName ErrorLevel Range Updates
- ---------------------------------------------
- WeekDay [n] 0-6 * 2.0 2.1
- Day [n] 1-31 * 2.0 2.1
- Month [n] 1-12 * 2.0 2.1
- Year 0-119 2.0
- FullYear 0-99 2.0 2.2
- Hour [n] 0-23 * 2.0 2.1
- Minute [n] 0-59 * 2.0 2.1
- Second 0-59 2.0
- AM 0-1 2.0
- PM 0-1 2.0
-
- For WeekDay, an ErrorLevel of 0 corresponds to Sunday. For Year, the ErrorLevel
- corresponds to the number of years since 1980. FullYear gives the last two
- digits of the current year. For AM and PM, an ErrorLevel of 1 is True, 0 is
- False.
-
- The commands with an asterisk also accept a single decimal number after the
- CommandName and compare it to the ErrorLevel that would be generated for the
- standard command. If the values are equal, the return ErrorLevel is 1,
- otherwise it is 0. This allows comparisons to be done by CFG vice using
- convoluted If ErrorLevel batch file structures.
-
-
- *### DESQview [BATCH]
- *
- Determine if Quarterdeck's DESQview is running. [Return]
-
- DESQview 2.0
-
- DESQview Exit ErrorLevels
- ---------------------------------------------
- 0 DESQview is not running
- Else DESQview version [(32 * major) + minor]
-
- Version 1.x identifies itself as version 1.0.
-
-
- *### Device [CONFIG/BATCH]
- *
- Determine if the specified device driver is resident in memory, rename it or
- display a list of installed drivers. [Return]
-
- Device SubCommandName {Options} 2.2 2.3
-
- Device Exit ErrorLevels
- ---------------------------------------------
- Exist 0 Not installed (also format error)
- 1 Installed
- Rename 0 Not renamed (also format error)
- 1 Renamed
-
- NOTE: Uses undocumented information.
-
- The following are valid SubCommandNames: Exist, List, Rename. Each
- SubCommandName may be abbreviated as desired. An error message is displayed if
- there is a format error.
-
- * Exist DeviceName: This command scans the linked list of device drivers and
- checks if the requested DeviceName is in the chain. It is important to
- note that this command searches for the *DOS* driver name, not the name of
- the file on disk. For example, SmartDrive's driver name is SMARTAAR,
- EMM386's is EMMXXXX0 and Symantec's Ncache2 is @CACHE-X. Some drivers
- hook in multiple driver headers and names for compatibility (Ncache2 also
- hooks SMARTAAR into the chain).
- * List: The DOS names of the installed device drivers are displayed. _All_
- device names are displayed (including block devices which often contain
- garbage) but sometimes have a name in their last seven places. Characters
- below ASCII 032 are replaced with ASCII 176 for display purposes.
- * Rename DeviceName1 DeviceName2: DeviceName1 is changed to DeviceName2. An
- error is displayed if the DeviceName1 is not found, the DeviceName2 is
- omitted or if DeviceName2 is longer than eight characters. Use this
- function with care since system operation may change as a result.
-
-
- *### Dir [BATCH]
- *
- Get the current drive and directory. [Return]
-
- Dir [/Q] [/@EnVar] [Path] 2.2
-
- Dir Exit ErrorLevels
- ---------------------------------------------
- 0 Successful
- Else DOS error number
-
- The resultant directory path includes the current drive. A final "\" is not
- appended. If anything is included on the command line, it is assumed to be a
- request for a canonicalized name of the supplied Path. The input path need not
- actually exist. If the Path is on a JOINed drive, the returned name is the one
- that would be needed if the drive were not JOINed; similarly for a SUBSTed,
- ASSIGNed or network drive letter. For this reason, it is possible to get a
- qualified name that is not legal under the current combination of SUBSTs,
- ASSIGNs, JOINs and network redirections.
-
- If the requested Path starts with ".." or ".", they are resolved to the parent
- directory and current directory, including drive letter, using DOS Function 60H.
- See the FileDir command for extracting the directory path from a supplied file
- name.
-
-
- *### DirExist [BATCH]
- *
- Determine if the requested directory exists on disk. [Return]
-
- DirExist [d:][path]DirectoryName 2.0
-
- DirExist Exit ErrorLevels
- ---------------------------------------------
- 0 Directory does not exist
- 1 Directory exists
-
-
-
- *### Display [BATCH]
- *
- Determine the display combination code. [Return]
-
- Display 2.0
-
- Display Exit ErrorLevels
- ---------------------------------------------
- 1 MDA 7 VGA mono
- 2 CGA 8 VGA color
- 4 EGA color 11 MCGA mono
- 5 EGA mono 12 MCGA color
- 6 PGS
-
-
- *### DosKey [BATCH]
- *
- Determine if the DOSKEY command line editing and recall program is installed or
- input/retrieve previous command lines. [Return]
-
- DosKey [/I] [/M] [/@EnVar] 2.2
-
- DosKey Exit ErrorLevels for /I
- ---------------------------------------------
- 0 Not installed or invalid DOS version
- 1 Installed
-
- The /I Installation switch overrides all others. All previous command line
- entries are accessible via the cursor keys. All of the normal DOS editing keys
- available with DOSKEY installed are accessible via this command except for F7
- Redisplay Commands.
-
- DOSKEY macros are available via this command. If a macro name or a command with
- DOSKEY special parameters may be entered, the /M Macro switch must be specified.
- Since DOSKEY automatically displays its string on screen, the /Q switch is
- permanently in effect. Note that DOSKEY does not append a carriage return/line
- feed to its string. This must be provided, if desired, in the batch file. This
- command requires DOS version 5.0 or higher.
-
- DOSKEY has only one buffered input function besides its installation check. When
- this function returns, an output buffer identical to that required for DOS
- Interrupt 21H Function 0AH is filled with the user input. If the user input a
- DOSKEY macro name or a string with special DOSKEY parameters, this buffer is
- empty and the function must be called again to obtain the expansion. This is
- what the /M Macro switch checks for. One side effect of this check is that if a
- carriage return is input on a blank line, DOSKEY returns the same information
- when it signals a macro expansion is pending. Since CFG cannot tell the
- difference between DOSKEY's output in these two situations, the program is
- written to assume that a macro/special parameter has been entered and loop back
- to retrieve the expansion of the macro/special parameter. The result is that
- with /M specified, a carriage return on a blank line will loop. At least one
- character must be entered to break out of the loop.
-
- If a macro expands to several commands (i.e. commands separated by the "$t"
- special character), each must be removed individually from DOSKEY's buffer.
- Assigning each to a unique EnVar will keep them straight. Executing the EnVar
- will execute the command line as if it had been typed from the DOS command line.
-
-
- *### DOSlocation [BATCH]
- *
- Determine the location of the DOS kernel. [Return]
-
- DOSlocation SubCommandName 2.3
-
- DOSlocation Exit ErrorLevels
- ---------------------------------------------
- 0 False
- 1 True
-
- The following are valid SubCommandNames: RAM, ROM, High, Low. Each
- SubCommandName may be abbreviated as desired, but must be unique.
-
-
- *### DOSstartup [BATCH]
- *
- Determine the drive from which DOS was booted. [Return]
-
- DOSstartup [/Q] [/@EnVar] 2.3
-
- This command uses DOS Function 33H Subfunction 5 to determine the boot drive.
- This command requires DOS version 4.0 or higher. If DOS is in ROM, the command
- returns the drive CONFIG.SYS is on. The drive letter is also written.
-
-
- *### DOSversion ### DOSmajor ### DOSminor [BATCH]
- *
- Determine the DOS version. [Return]
-
- CommandName ErrorLevel Range Updates
- ---------------------------------------------
- DOSmajor 2 - 6 2.0
- DOSminor 0 - 99 2.0
- DOSversion [/T] (32 * major) + minor 2.0 2.2
-
- For DOSminor, the return ErrorLevel is 22 for DOS 6.22, 31 for DOS 3.31, etc.
- Note that DOS 4.01 reports itself as 4.00. The /T True Version switch executes
- the DOS 5.0+ Interrupt 21H Function 33H Subfunction 06H. The regular DOS
- version function is used if the true version call fails.
-
-
- *### Drive [BATCH]
- *
- Determine the current default drive. [Return]
-
- Drive [/Q] [/@EnVar] 2.0
-
- Drive Exit ErrorLevels
- ---------------------------------------------
- 1-26 Drive Number (A=1)
-
- The default drive is displayed.
-
-
- *### DriveExist [BATCH]
- *
- Determine if the requested drive letter is a valid DOS drive. [Return]
-
- DriveExist d: 2.0 2.32
-
- DriveExist Exit ErrorLevels
- ---------------------------------------------
- 0 Invalid
- 1 Valid
-
- where "d:" corresponds to the drive to be tested.
-
-
- *### DriveID [BATCH]
- *
- Identify the type of drive specified. [Return]
-
- DriveID d: [/F|/P] 2.4
-
- DriveID Exit ErrorLevels
- ---------------------------------------------
- Physical drive ID 0 320K/360K disk
- 1 1.2M disk
- 2 720K disk
- 3 Single-density 8-inch disk
- 4 Double-density 8-inch disk
- 5 Fixed disk
- 6 Tape drive
- 7 1.44M disk
- 8 Read/write optical disk
- 9 2.88M disk
- 13 RAM disk
- 14 CD-ROM
- 15 Unidentified
- Drive type flags 0 Physical
- (added to above) 16 SUBST
- 32 JOIN
- 64 Remote
- 128 Invalid
- Other 253 /P specified on non-physical drive (no error
- message)
- 254 Invalid drive designation
- 255 Invalid DOS version
-
- NOTE: Uses undocumented information. There are quite a number of possible
- return ErrorLevels depending on exactly what drive you test. All
- ErrorLevels greater than 127 indicate an invalid drive.
-
- This command identifies the type of drive specified on the command line by
- examining the DOS Current Directory Structure. If the flags identify the drive
- as a physical one, Interrupt 21H Function 44H Subfunction 0DH is called to
- identify the drive type. This command requires DOS version 5.0+.
-
- If the flags indicate a CD-ROM drive, the flag ErrorLevel is cleared and the CD-
- ROM ErrorLevel is returned. If the drive is unidentified, and the RamDrive
- command tests are satisfied, the flag ErrorLevel is cleared and the RamDrive
- ErrorLevel is returned.
-
- The /F Flags switch returns an ErrorLevel according to the drive type flags.
- The /P Physical switch returns an ErrorLevel according to the physical drive ID.
- The /F switch overrides the /P switch if both are specified. With no switch
- specified, the drive type flag ErrorLevel and physical drive ID ErrorLevels are
- additive.
-
-
- *### DriveReady [BATCH]
- *
- Determine if a drive is ready for access. [Return]
-
- DriveReady d: 2.0 2.32
-
- DriveReady Exit ErrorLevels
- ---------------------------------------------
- 0 Drive not ready
- 1 Drive ready
-
- where "d:" corresponds to any single drive letter. The DriveExist command is
- called first. The command then installs a replacement DOS Critical Error
- Handler to trap the resultant error if the drive is not ready when Interrupt 21H
- Function 1CH (Get Allocation Information for Specific Drive) is executed.
-
-
- *### DriveSize [BATCH]
- *
- Determine the size of the specified or default drive. [Return]
-
- DriveSize [/Dn] [d:] 2.0
-
- DriveSize Exit ErrorLevels
- ---------------------------------------------
- 0 Invalid drive error
- 1-255 Blocks of space on the drive
-
- where "d:" corresponds to the drive desired. If the drive is omitted, the
- default drive is used. The command returns the number of full and partial
- blocks on the drive. The default block size is 100 kilobytes. A different
- block size may be specified with the /Dn switch. The /Dn switch "n" value for
- this command is measured in kilobytes. If more than 255 blocks are on the
- drive, the returned ErrorLevel will be 255.
-
-
- *### DriveSpace [BATCH]
- *
- Determine the amount of free disk space on the specified or default drive.
- [Return]
-
- DriveSpace [/Dn] [d:] 2.0
-
- DriveSpace Exit ErrorLevels
- ---------------------------------------------
- 0 No blocks available or invalid drive error
- 1-255 Blocks of space available
-
- where "d:" corresponds to the drive desired. If the drive is omitted, the
- default drive is used. The command returns the number of full blocks available.
- Partial blocks are ignored. The default block size is 100 kilobytes (102,400
- bytes). A different block size may be specified with the /Dn switch. The /Dn
- switch "n" value for this command is measured in kilobytes. If more than 255
- blocks are available, the returned ErrorLevel will be 255.
-
-
- *### DriveVolume [BATCH]
- *
- Determine if a particular disk volume exists on the named drive. [Return]
-
- DriveVolume [d:]VolumeName 2.0 2.2 2.32
-
- DriveVolume Exit ErrorLevels
- ---------------------------------------------
- 0 Volume does not exist
- 1 Volume exists
-
-
- *### DS4 [BATCH]
- *
- Determine if a Toshiba portable computer is installed in a DeskStation IV desk
- top unit. [Return]
-
- DS4 2.1
-
- DS4 Exit ErrorLevels
- ---------------------------------------------
- 0 Not installed
- 1 Installed
-
- NOTE: Uses undocumented information.
-
-
- *### Echo [CONFIG/BATCH]
- *
- Send a comment line to the screen. [Return]
-
- Echo [/C | /N] [String] 1.0 2.1
-
- The /C switch is used to output a carriage return only at the end of the String,
- returning the cursor to the first column for overwriting the previous output.
- The /N switch is used to eliminate the final carriage return/line feed, leaving
- the cursor at the end of the String just displayed. /N takes precedence over /C
- if both are included. The /Q switch has no affect on this command. Use Cecho
- to output text in a specific color. Used without String, Echo outputs a
- carriage return/line feed sequence.
-
- Since DOS capitalizes everything in CONFIG.SYS during its parsing scan, a carat
- [^] is used as the default character to toggle between upper and lower case for
- the displayed string. If a carat is desired on the displayed line, two carats
- [^^] should be used on the input line. This format character is in effect only
- during execution from CONFIG.SYS.
-
- A tilde [~] is the default character for insertion of a carriage return/line
- feed sequence in the displayed line. If a tilde is desired on the displayed
- line, two tildes [~~] should be used on the input line. This format character
- is in effect at all times.
-
- If String is preceded by a double quote ["], the double quote is deleted but
- leading separators are not removed.
-
- Example command lines:
-
- Echo S^tart ^DEVICE ^section...~
- Echo " S^tart ^DEVICE ^section...~
-
- The first command line would display "Start DEVICE section..." with two trailing
- carriage return/line feeds. The second command line would display " Start
- DEVICE section..." with two trailing carriage return/line feeds.
-
-
- *### EchoPause [CONFIG/BATCH]
- *
- Suspend execution after printing a prompt message on the screen that is
- specified on the command line. [Return]
-
- EchoPause [/C | /N] [String] 1.0 2.1
-
- Pressing any key resumes execution. See the Echo command for String formatting
- and switches. Use KeyPause for optional pausing, Pause for a standard pause
- message or WaitFor for timed pausing.
-
-
- *### EGA25 [CONFIG/BATCH]
- *
- Set a 25 line color EGA screen. [Return]
-
- EGA25 [/C] 1.0 2.0
-
- Performs a mode 3 reset of the display adapter using Interrupt 10H Function 0.
- This works on EGA in a display independent way. The /C switch clears the screen
- after switching modes if ANSI is installed to set the screen color.
-
-
- *### EGA43 [CONFIG/BATCH]
- *
- Set a 43 line EGA screen. [Return]
-
- EGA43 [/C] 1.0 2.0 2.4
-
- Forces the use of the display adapter's internal 8x8 font. Interrupt 10H
- Function 11H Subfunction 12H performs an adapter mode reset when it executes.
- This works on EGA in a display independent way. The /C switch clears the screen
- after switching modes if ANSI is installed to set the screen color.
-
- This command is operable only for video modes 0-3.
-
-
- *### Env [BATCH]
- *
- Determine size and use of the DOS master environment and manipulate environment
- strings. [Return]
-
- Env SubCommandName [/Dn] [/1] [/2] 2.0 2.1 2.2 2.3 2.32 2.4 2.43
-
- NOTE: Uses undocumented information. Environment variable names must be in
- capital letters for the DOS SET command to use them.
-
- This command performs several functions relating to the DOS: It either returns
- information about the DOS or it manipulates the strings in that environment.
- For information SubCommands, results are returned via ErrorLevel. For string
- SubCommands, CFG manipulates the environment of either the master command
- processor (default, /1) or, the parent command processor (/2). Under Windows
- 95, there is only one environment, so the /1 and /2 switches have identical
- output.
-
- The following are valid SubCommandNames: Caps, Clear, Fill, Free, Reset, Save,
- Set, Strings, Total, Used. Each SubCommandName may be abbreviated as desired.
- The default block size for information SubCommands is 16 bytes. A different
- block size may be specified with the /Dn switch. The /Dn switch "n" value for
- this command is measured in bytes. The /Dn switch has no meaning for string
- SubCommands. The /2 switch will locate the environment of the parent program
- for examination vice the master environment. If CFG is executed under a
- secondary command processor, use of this switch will determine the
- characteristics of the environment available to any other program executed under
- that secondary command processor. It also provides an alternate method of
- locating the master environment when CFG is executed under the master command
- processor.
-
- * Caps: Capitalizes the names of all environment variables.
- * Clear: Removes _*ALL*_ strings from the environment. Use with _*EXTREME
- CAUTION*_.
- * Fill: Creates a series of environment strings named "CFGxxx" that
- completely use all available environment space. "xxx" is a decimal number
- that ranges from 001 to as high as required. This ensures that any
- spawned command processors are created with an environment that has the
- same size as the parent command processor. Deleting these strings (either
- with the Reset SubCommand or multiple DOS SET commands) frees the
- environment space. Each string uses a maximum of 80 bytes.
- * Free: Reports the number of blocks of space available for use. This is
- equal to Total minus Used.
- * Reset: Removes the strings created by the Fill SubCommand. These strings
- may also be removed using DOS SET commands. This command may take several
- seconds on very large environments. This command searches for the CFG001
- variable and deletes all further sequential variables it finds.
- * Save [FileName]: Copies the strings from the designated environment
- preceded by "@SET " or "SET ", as appropriate. If the optional FileName
- is present, the strings are written to it. Otherwise, they are written to
- DOS StdOut. Only one environment (/1 or /2) should be specified.
- * Set /@EnVar String: The /@EnVar switch is required. The String which
- follows is placed in the environment. Environment variables in String are
- not processed by CFG, but by DOS prior to passing the command line to CFG.
- If String is preceded by a double quote ["], the double quote is deleted
- but leading separators are not removed.
- * Strings: Reports the number of strings currently defined in the
- environment. This option has a unchangeable /Dn switch value of 1.
- * Total: Reports the number of blocks of space in the environment. Because
- of the way DOS allocates memory, the size in bytes will always be a
- multiple of 16.
- * Used: Reports the total number of blocks of space currently in use. This
- will be dependent on the number and length of existing environment
- variables. This value includes the null bytes that terminate each string.
-
-
- *### ErrorLevel [BATCH]
- *
- Return a DOS ErrorLevel equal to the number on the command line. [Return]
-
- ErrorLevel n 2.3 2.42
-
- where "n" is a number between 0 and 255 decimal. Numbers greater than 255
- return 255. Non-numbers return 0. The /Bn switch will allow input in other
- number bases.
-
-
- *### FileDir ### FileDrive [BATCH]
- **### FileExt ### FileName**
- *
- Returns the requested portion of the given file name string. [Return]
-
- FileDir Filename [/Q] [/@EnVar] 2.2
- FileDrive Filename [/Q] [/@EnVar] 2.2
- FileExt Filename [/Q] [/@EnVar] 2.2
- FileName Filename [/Q] [/@EnVar] 2.2
-
- FileDir, FileDrive, FileExt and FileName are a group of related commands that
- separate out portions of a supplied file name string. This is best shown by
- example. Suppose CFG.COM exists in the current default directory of C:\CFG.
- The above commands will return the following values given a command line of "CFG
- CommandName CFG.COM":
-
- FileDir \CFG
- FileDrive C:
- FileExt COM
- FileName CFG
-
- CFG uses DOS Interrupt 21H Function 60H to canonicalize the supplied path.
- FileDir is almost the same as the Dir command except that you can specify other
- than the current directory, if desired.
-
-
- *### FileDTC [BATCH]
- *
- Compare the date and time stamps of two files. [Return]
-
- FileDTC [d:][path]File1 [d:][path]File2 2.0 2.32 2.43
-
- FileDTC Exit ErrorLevels
- ---------------------------------------------
- 0 Command line error
- 1 Date1 is older than Date2
- 2 Date1 = Date2, but Time1 is older than Time2
- 3 File1 DOS error on opening
- 4 Date1 = Date2, and Time1 = Time2
- 5 File2 DOS error on opening
- 6 Date1 = Date2, but Time2 is older than Time1
- 7 Date2 is older than Date1
-
- FileDTC (File Date-Time Compare) compares the date and time stamps of two files.
- FileDTC does not accept wildcards in the file names. An ErrorLevel of 1, 2 or 3
- indicates File1 either does not exist or is older than File2. An ErrorLevel of
- 5 or higher indicates that File2 either does not exist or is older than File1.
- An error message is displayed if either file cannot be found.
-
- FileDTC can be used as follows:
-
- IfCopy.Bat
- @Echo Off
- If [%1]==[...] GoTo 1
- If [%2]==[] GoTo End
- For %%A In (%1) Do Call IfCopy ... %%A %2
- GoTo End
- :1
- CFG FileDTC %2 %3%2
- If ErrorLevel 4 GoTo End
- Copy %2 %3%2 >Nul
- :End
-
- Issuing "IfCopy *.* A:" will copy all files from the current directory to the A:
- drive that are older than those on the A: drive or do not exist. This is a
- little more discriminating than Xcopy /d since it also compares times.
-
-
- *### FileExist [BATCH]
- *
- Determine if the specified file exists. [Return]
-
- FileExist [d:][path]FileName 2.0
-
- FileExist Exit ErrorLevels
- ---------------------------------------------
- 0 File does not exist
- 1 File exists
-
- This command is similar to the DOS "IF EXIST" batch file command.
-
-
- *### FileLines [BATCH]
- *
- Determine the number of lines (records) in the specified file. [Return]
-
- FileLines [d:][path]Filename [/Dn] 2.4
-
- FileLines Exit ErrorLevels
- ---------------------------------------------
- 0 Zero length file or file error
- Else Number of lines
-
- This command counts the number of lines or records in an ASCII file by searching
- for carriage return characters (ASCII 013). The last line of a file will be
- counted even if it does not end in a carriage return/line feed sequence. A line
- which ends a file and does end with a carriage return/line feed will not count
- as an additional line.
-
- This command has a /Dn block size of one, but I count using 32-bits (just in
- case).
-
-
- *### Files [BATCH]
- *
- Determine size and use of the DOS System File Table. [Return]
-
- Files SubCommandName 2.0
-
- NOTE: Uses undocumented information.
-
- This command returns information about the DOS System File Table (SFT) that is
- created through the FILES command in CONFIG.SYS as well as third party
- extenders. All information is returned via ErrorLevel. The following are valid
- SubCommandNames: Blocks, Free, Margin, Orphan, Previous, Total, Used. Each
- SubCommandName may be abbreviated as desired. This command requires DOS 3.0+.
-
- * Blocks: Number of blocks the SFT is divided into. A large number of
- blocks has little effect on performance, but may use up extra memory.
- * Free: Number of entries available for use. This is equal to Total minus
- Used.
- * Margin: Minimum margin that existed at the "high water mark" of previous
- use. This is equal to Total minus Previous. This value is how close the
- system has gotten to a DOS file error due to no more file handles being
- available.
- * Orphan: Number of entries that are orphaned, typically by redirecting the
- output of a resident program to the NUL device during installation. This
- number is a subset of the Used files.
- * Previous: Maximum number of files that had previously been open at any one
- time since the computer was last booted. Since DOS reuses entries after
- they have been closed, this value may be looked at as the "high water
- mark" of SFT use.
- * Total: All entries available in the SFT, including any that may have been
- created by later programs such as Qemm's FILES or PC Magazine's UMBFILES.
- * Used: Number of entries currently in use. Typically, this will be 3
- unless files have been orphaned or Windows is running.
-
-
- *### FileSize [BATCH]
- *
- Determine the size of the specified file. [Return]
-
- FileSize [/Dn] [d:][path]Filename 2.0 2.1 2.2
-
- FileSize Exit ErrorLevels
- ---------------------------------------------
- 0 File error
- 1-255 Blocks of the file
-
- The command returns the number of full and partial blocks in the file. The
- default block size is 1024 bytes (1 kilobyte). A different block size may be
- specified with the /Dn switch. The /Dn switch "n" value for this command is
- measured in bytes. If more than 255 blocks are in the file, the returned
- ErrorLevel will be 255. An error message is displayed if the file cannot be
- found.
-
-
- *### FileText [BATCH]
- *
- Determine if the Text string exists in the specified file. [Return]
-
- FileText [d:][path]Filename [/C] "String" 2.0 2.31
-
- FileText Exit ErrorLevels
- ---------------------------------------------
- 0 String not present
- 1 String present
-
- This command performs a case sensitive search of the designated file for the
- text string. If the /C Case switch is used, a case insensitive search is
- performed. An error message is displayed if the file cannot be found.
-
-
- *### GamePort [BATCH]
- *
- Determine if a game port is installed. [Return]
-
- GamePort [/Q] 2.4
-
- GamePort Exit ErrorLevels
- ---------------------------------------------
- 0 Game port not installed
- 1 Game port installed
-
- A message is displayed with the results.
-
-
- *### GetKey [BATCH]
- *
- Get any keyboard input or limit the allowed keys to those specified on the
- command line. [Return]
-
- GetKey [/C] [/F] [/S] ["String"] [Al] [Cl] [D[:]t,p] [E] [Fn] [Sn] [m] 2.0 2.2 2.42
-
- GetKey Exit ErrorLevels
- ---------------------------------------------
- With list Position of key n lit (1, 2, 3, etc.)
- Without list Scan code of key pressed
- 255 Ctrl-Break/Ctrl-C pressed (if not specified)
-
- where:
- * /C - Comparison of characters in "String" is case sensitive.
- * /F - Flushes the keyboard buffer prior to execution.
- * /S - Causes the key pressed to be shown on screen.
-
- These options may be placed in any order after the CommandName:
- * "String" is a series of characters representing valid keyboard input.
- String must be enclosed in either single or double quotes.
- * "Al" and "Cl" are Alt-letter and Ctrl-letter combinations.
- * "D:t,p" represents a delay time "t" and default key position "p" to return
- if no choice is made after "t" seconds. "t" can be between 1 and 3640.
- "p" cannot exceed the length of the provided list plus one. The "list
- plus one" option allows the detection of no choice.
- * "E" is the Escape key.
- * "Fn" are function keys F1 through F12. F0 represents the Return or Enter
- key. Multiple function keys must be separated.
- * "Sn" adds (shifts) "n" to the returned ErrorLevel. This allows testing of
- multi-layered menus in one pass. The maximum value is 254. This option
- may be placed anywhere after the CommandName.
- * "m" is for direct keyboard scan codes.
-
- There may be multiple occurrences of "String" on the input line. The number of
- input keys is only limited by DOS command line length.
-
- Used without options, GetKey returns the scan code of the key that was pressed.
- GetKey's optional key list provides much greater functionality. If you supply
- the optional "String" or other arguments to GetKey, CFG will wait either until
- one of those keys listed has been pressed or until you break out of the command
- with Ctrl-Break or Ctrl-C. All other keypresses are ignored. A time limit may
- be specified using the "D:t,p" option. If no "p" option is specified, 1 is
- used.
-
- By default, the GetKey command is not case sensitive (i.e. if either "Y" or "y"
- is pressed, the ErrorLevel will be the same) unless the /C switch is used. If
- you want the single quote included as a valid keypress, enclose it in double
- quotes and vice versa. Standard separators between the listed keys are parsed
- out.
-
- Example command line:
-
- GetKey "yn" F1 F2 F0 AC CC E "abc"
-
- If F1 is now pressed, the returned ErrorLevel will be 3, since F1 is the third
- entry in the list. Ctrl-C will return 7 in this case vice 255 since it is
- specified on the command line.
-
-
- *### Help [BATCH]
- *
- Display program scrollable help. [Return]
-
- Help [String] 2.1 2.4
-
- Without the optional String, this command is the same as using the /? switch and
- displays the CFG.HLP file. With any String on the command line, CFG.DOC is
- loaded and scanned (case insensitive) until String is found preceded by "###".
- Command headers are formatted thus.
-
- The CFG.DOC and CFG.HLP files must be in the same directory as CFG.COM in order
- to be found. This command is not available in MultiCommand mode.
-
-
- *### IACAfill [CONFIG]
- *
- Write up to 16 bytes to the Intra-Application Communication Area (IACA) for
- communication between CONFIG.SYS and AUTOEXEC.BAT. [Return]
-
- IACAfill String [/O] 1.1 2.1
-
- There are 16 bytes at address 0040:00F0 called the IACA. These bytes can be
- modified by any program, but few applications actually use them since they are
- subject to change by any program and do not provide for much storage.
-
- The IACAfill command moves the command line String to the IACA. The String must
- be a single word. A space or carriage return will end the transfer. The /O
- Overwrite switch will unconditionally overwrite anything in the IACA. By
- default, IACAfill will not overwrite. IACAfill fills the unused part of the
- IACA with ASCII zeroes.
-
- IACAfill allows communication between CONFIG.SYS and AUTOEXEC.BAT on pre-DOS 6.0
- systems. When managing multiple configurations, this will allow you to set a
- variable in each separate CONFIG.SYS file for appropriate action in
- AUTOEXEC.BAT. Use the IACAread command to read the string from the IACA.
-
- Example command line:
-
- IACAfill 386Max
-
- This will store "386MAX" in the IACA.
-
-
- *### IACAread [BATCH]
- *
- Reads up to 16 bytes from the Intra-Application Communication Area. [Return]
-
- IACAread [/Q] [/@EnVar] [/C] [String] 2.0 2.1 2.2
-
- IACAread Exit ErrorLevels
- ---------------------------------------------
- 0 No errors encountered
- 1 No string present in the IACA
-
- String may be any combination of characters that are desired to precede the
- string read from the IACA. The /C switch causes the old data to be cleared from
- the IACA. An error message will be displayed if there is no string in the IACA.
-
- IACAread first checks the IACA for a string. It then scans its command line and
- writes anything it finds there and then writes the IACA. The IACA is not
- cleared after reading unless the /C switch is used.
-
- Example command use:
-
- CFG IACAread @SET EnVar=>%TEMP%\IACA.BAT
- CALL %TEMP%\IACA.BAT
- DEL %TEMP%\IACA.BAT
-
- where EnVar is the name of the environment variable to be set. This will write
- "@SET EnVar=String" to DOS StdOut. Using CFG's ability (as of version 2.2) to
- write directly to the master environment, the above can be shortened to:
-
- CFG IACAread /Q /@EnVar
-
- If the SET command in the example IACA.BAT file does not work, you should have
- received an "Out of environment space" error from DOS during execution. Check
- the free environment space using the Env Free command. Environment space may be
- increased by placing a larger number after the /E: switch on the CONFIG.SYS
- SHELL line or adding such a line with a /E: switch to the file if none exists
- and rebooting. See the "Sample" section below.
-
-
- *### Input [BATCH]
- *
- Get a line of input. [Return]
-
- Input [/Q] [/@EnVar] 2.2
-
- This command uses DOS Interrupt 21H Function 0AH (Buffered Input) to get a
- string from the user. This string may be stored in the environment using the
- /@EnVar switch. If /Q is used, the cursor remains at the left most screen
- column. If /Q is not used, the cursor is left at the end of the input line.
- The maximum length line accepted is 254 characters.
-
-
- *### Intense [CONFIG/BATCH]
- *
- Enable intense background colors. [Return]
-
- Intense 2.0
-
- Interrupt 10H Function 10H Subfunction 3 is used to enable intense background
- colors on EGA and above. Any blinking characters will stop blinking and have
- intense backgrounds.
-
-
- *### Keyboard [CONFIG/BATCH]
- *
- Determine if an enhanced/standard keyboard is installed or enable/disable the
- keyboard. [Return]
-
- Keyboard SubCommandName [/Q] 2.1 2.43
-
- * Disable: Disables the keyboard. No further keyboard input is accepted
- until the Enable subcommand is run. CAUTION: Use this command carefully
- since the only way to restore your keyboard if you forget to run the
- Enable subcommand from your batch file is by a hardware reset. Use this
- as the first CONFIG.SYS command to keep people from breaking out of your
- startup files. NOTES: Some programs my perform the proper hardware reset
- and restore keyboard operation. Test your setup. This is not a resident
- function. Do not try to invoke the GetKey command, since it too is
- disabled. This subcommand disables the Ctrl-Alt-Delete reset and Ctrl-
- Break from the keyboard.
- * Enable: Enables the keyboard after using the Disable subcommand. Use this
- as the last AUTOEXEC.BAT command. CAUTION: Ensure that this subcommand
- is executed in all possible startup configurations if you have multiple
- configurations.
- * Status: Examines the keyboard status byte at 0040:0096 to see if bit 4 is
- set. If it is, an enhanced keyboard is assumed to be attached to the
- system. This subcommand has no meaning from CONFIG.SYS.
-
- Keyboard Status Exit ErrorLevels
- ---------------------------------------------
- 0 Standard keyboard is installed
- 1 Enhanced keyboard is installed
-
-
- *### KeyBuffer [BATCH]
- *
- Adjust the DOS default keyboard buffer between 2 and 16 characters. [Return]
-
- KeyBuffer SubCommandName 2.1 2.4
-
- KeyBuffer Exit ErrorLevels
- ---------------------------------------------
- 0 Parsing error
- Else Number of bytes (with Set or Status)
- Else Number of blocks (with Status /Dn)
-
- This command changes the size of the available DOS keyboard buffer. The
- following are valid SubCommandNames: Set, Status. Each SubCommandName may be
- abbreviated as desired.
-
- * Set n: Requires a value for the new size. Valid numbers for "n" range
- between 2 and 16.
- * Status [/Dn]: Returns the current buffer size in blocks as an ErrorLevel
- even if the buffer has been relocated. The default block size is 1 byte.
- A different block size may be specified with the /Dn switch. The /Dn
- switch "n" value for this command is measured in bytes and has meaning
- only with this SubCommand.
-
- An error is displayed if the keyboard buffer has been shifted from the DOS
- default location. This command is intended for a young typist who may
- improperly hit multiple keys to force an early keyboard buffer full beep from
- the BIOS.
-
-
- *### KeyFlush [CONFIG/BATCH]
- *
- Flush any waiting keys from the keyboard buffer. [Return]
-
- KeyFlush 2.2
-
- This command checks for available keys and repeatedly reads the keyboard until
- they are all cleared from the keyboard buffer.
-
-
- *### KeyPause [CONFIG/BATCH]
- *
- Suspend execution if any of the Shift, Alt or Ctrl keys are pressed. [Return]
-
- KeyPause 1.0 2.0 2.3
-
- KeyPause Exit ErrorLevels
- ---------------------------------------------
- 0 Pause not executed
- 1 Pause executed
-
- One of the shift keys must be held down before program execution. Execution
- resumes once the key is released. Use EchoPause to display a customized pause
- message, Pause for a standard pause message or WaitFor for timed pausing.
-
-
- *### KeyPress [BATCH]
- *
- Determine if there is a key waiting in the keyboard buffer. [Return]
-
- KeyPress 2.2
-
- KeyPress Exit ErrorLevels
- ---------------------------------------------
- 0 No keys available
- 1 Keys are available
-
-
- *### KeyStuff [CONFIG/BATCH]
- *
- Place the command line characters into the BIOS keyboard buffer. [Return]
-
- KeyStuff String 2.2
-
- KeyStuff Exit ErrorLevels
- ---------------------------------------------
- 0 No characters inserted
- Else Number of characters inserted
-
- The characters appearing after the CommandName are placed in the buffer.
- Leading spaces are parsed off. No maximum buffer length or location is assumed.
- The command will place one less than the full buffer of characters into the
- buffer, preventing CFG from interfering with the BIOS buffer logic.
-
-
- *### LastBoot [BATCH]
- *
- Determine how the system was last booted. [Return]
-
- LastBoot 2.2
-
- LastBoot Exit ErrorLevels
- ---------------------------------------------
- 0 Cold boot (Flag value = 0000H)
- 1 Warm boot (Flag value = Else)
- 2 Warm boot (Flag value = 1200H)
- 3 Warm boot (Flag value = 1234H)
-
- The command examines the BIOS boot flag at 0040:0072 to determine the method of
- the last system boot. A flag value of zero is assumed to be a cold boot. The
- normal flag value for a warm boot is 1234H. Some BIOS versions overwrite the
- lower byte of this with a zero, resulting in a flag value of 1200H for a warm
- boot. Any other non-zero flag value is also identified and assumed to be a warm
- boot.
-
-
- *### LastDrive [BATCH]
- *
- Determine letter of last available drive. [Return]
-
- LastDrive [/Q] [/@EnVar] 2.1
-
- LastDrive Exit ErrorLevels
- ---------------------------------------------
- 0-255 Drive Number (A=0)
-
- NOTE: Uses undocumented information.
-
- The lowest value this command can return is E:.
-
-
- *### Left [BATCH]
- *
- Return the left most "n" characters from String. [Return]
-
- Left n String [/Q] [/@EnVar] [/C] 2.2 2.32
-
- where "n" is a decimal number indicating the number of characters to return from
- String, counting from the left. The /C switch capitalizes the returned string.
-
-
- *### Length [BATCH]
- *
- Return the length of the input String. [Return]
-
- Length String [/Q] [/@EnVar] 2.2
-
- If String is preceded by a double quote ["], the double quote is deleted but
- leading separators are not removed.
-
-
- *### Locate [CONFIG/BATCH]
- *
- Set cursor position on active video page. [Return]
-
- Locate r c 2.0
-
- Locate Exit ErrorLevels
- ---------------------------------------------
- 0 No errors
- 255 Input parsing error
-
- where "r" corresponds to the row number and "c" corresponds to the column
- number. The top row is row 1. The furthest left column is column 1. Decimal
- numbers are required.
-
-
- *### Lock [BATCH]
- *
- Locks up the system after optionally displaying a fake error message. [Return]
-
- Lock [SubCommandName] [/C] 2.3
-
- CAUTION: This command requires a system reset after execution.
-
- The following are valid SubCommandNames: Disk, Net, None, Stack, System. Each
- SubCommandName may be abbreviated as desired. No actual error occurs. The /C
- ColdBoot switch requires a hardware reset. This command is Windows-aware if the
- /C switch is used.
-
- * Disk: Displays "Not ready reading drive C; Abort, Retry, Fail?".
- * Net: Displays "Error accessing network".
- * None: Displays nothing. Default if SubCommandName is omitted.
- * Stack: Displays "Internal stack overflow; System halted".
- * System: Displays "Internal error; System halted".
-
-
- *### Lower [BATCH]
- *
- Return String all in lower case. [Return]
-
- Lower String [/Q] [/@EnVar] 2.2
-
- If String starts with a double quote ["], the double quote is deleted but
- leading separators are not removed.
-
-
- *### LptHide [CONFIG]
- *
- Hide and restore the printer port base addresses. [Return]
-
- LptHide SubCommandName 1.0
-
- The following are valid SubCommandNames: Hide, Restore. Each SubCommandName may
- be abbreviated as desired. Error messages are displayed if the routine fails.
-
- * Hide: Hides the printer port base addresses by copying them to a high
- memory location.
- * Restore: On restoration, the command verifies the signature and checksum
- stored with the port addresses to ensure that they were not accidentally
- over-written during intervening device driver execution. The command then
- copies the base addresses back to their normal location.
-
- Example command sequence:
-
- CFG.COM LptHide Hide
- RCD.SYS /M0
- CFG.COM LptHide Restore
-
- The specific program this was written for is the Iomega Bernoulli Box RCD.SYS
- driver, though it may be useful at other times. During RCD.SYS execution, it
- interrogates the printer ports to determine if there are any parallel port
- Bernoulli Boxes installed. Unfortunately, some printers respond to this by
- printing the interrogation sequence.
-
- The default location for the hidden data is 7000:0000 for DOS versions before
- 5.0. This is below the 512 KB boundary in the event that the machine only has
- that much base memory available, and high enough to keep it from being over-
- written during execution of other device drivers while the data is hidden. For
- DOS Version 5.0+, the location will vary depending on what the SysInit loader
- module reports as the maximum available memory in the device driver header.
- This prevents interference with the larger memory requirements in the upper
- areas around the 640 KB point that can occur under DOS 6.0+ with large multiple-
- configuration CONFIG.SYS files.
-
-
- *### LptSet [CONFIG/BATCH]
- *
- Sets the parallel port base addresses to a default or specified value. [Return]
-
- LptSet a [b] 2.4
-
- CAUTION: This command changes values established by the BIOS on system startup.
- Be _very careful_ with its use.
-
- Where "a" corresponds to the desired port base address to set: 1, 2 or 3. The
- "b" corresponds to an optional hexadecimal value to set the port base address
- to. No checking is performed to warn of values being overwritten.
-
- This command places a default port base address value (or the specified value)
- in the appropriate location in the low memory DOS data area. The default values
- used for the ports are 3BCH, 378H and 278H. If your system uses different
- values, you must specify them as "b" on the command line.
-
- You can set multiple base addresses to the same value to access the same
- physical port using different DOS port names. The IRQ associated with a
- specific parallel port has no impact since they are generally all the same.
-
-
- *### LptSwap [CONFIG/BATCH]
- *
- Swap the printer base port addresses for the two printer ports specified.
- [Return]
-
- LptSwap a b 1.0 2.4
-
- where "a" and "b" are the numbers of the printer ports to be swapped. Valid
- numbers are 1, 2 and 3. An error message will be given if one of the ports is
- missing or invalid.
-
- LptSwap switches the two ports as far as DOS is concerned. This is useful if
- you need to shift the printer ports around and are loading a software print
- buffer as a device driver. The contents of the port addresses are not checked
- during the swap.
-
- Example command line:
-
- LptSwap 1 3
-
-
-
- *### MachineName [BATCH]
- *
- Determine the network machine name. [Return]
-
- MachineName [/Q] [/@EnVar] 2.2 2.3
-
- This command will display a name only if network software is loaded. This
- command requires DOS version 3.1 or higher.
-
-
- *### Memory [BATCH]
- *
- Determine amount of memory available. [Return]
-
- Memory SubCommandName [k] [/Dn] [/Q] [/@EnVar] 2.0 2.2 2.3
-
- Memory Exit ErrorLevels
- ---------------------------------------------
- With "k" 0 Requested amount of memory is not available or format
- error
- 1 Requested amount of memory is available
- Without "k" 0 Requested memory is not available or format error
- Other Number of blocks of memory available
-
- where "k" is the number of kilobytes required. Valid SubCommandNames are: Base,
- Extended, Expanded, High, Main, UMB. Each SubCommandName may be abbreviated as
- desired, but must be unique. A screen report is made (unless /Q is used) and
- the exit ErrorLevel is set to the number of blocks of available memory. The /Dn
- switch "n" value for this command is measured in kilobytes. The /@EnVar switch
- will place the total number of kilobytes in the desired environment variable.
- CFG scans the command line for a decimal number after the SubCommandName. This
- number is compared to the number of available kilobytes of the requested type of
- memory.
-
- * Base: CFG executes BIOS Interrupt 12H to get the among of contiguous
- memory installed in the system. The default block size is 16 kilobytes.
- * Extended: CFG checks for the presence of an XMS driver and calls it if
- present. Interrupt 15H Function 88H is used otherwise. The default block
- size is 64 kilobytes.
- * Expanded: CFG checks for the presence of an EMS driver and then executes
- Interrupt 67H Function 42H to get the number of free expanded memory
- pages. The pages are converted to kilobytes for reporting. The default
- block size is 64 kilobytes.
- * High: Under DOS version 5.0 or higher, CFG uses Interrupt 2FH Function 4AH
- Subfunction 01H to query free space in the High Memory Area. The default
- block size is 1 kilobyte.
- * Main: CFG calculates available memory based on the location of its PSP and
- using Interrupt 12H. The default block size is 16 kilobytes.
- * UMB: Under DOS version 5.0 and higher, CFG attempts to link the UMB chain
- with the low DOS memory chain to determine the largest free available
- block. If this fails or an earlier DOS version is in use, the XMS
- provider is queried, if present. The default block size is 1 kilobyte.
-
- Example command lines:
-
- CFG Memory M 512 -- Test for 512 KB main memory
- CFG Memory Exp 2048 -- Test for 2 MB expanded memory
- CFG Memory Base /D64 -- Base memory in 64 KB blocks
-
-
- *### Mid [BATCH]
- *
- Return "n" characters from String starting at position "m". [Return]
-
- Mid m n String [/Q] [/@EnVar] [/C] 2.2 2.32
-
- where "m" and "n" are decimal numbers. "m" is the starting position and "n" is
- the number of characters to return. The first letter of String is position 1.
- If "m" is zero or past the end of String, nothing is returned. "n" may extend
- past the end of the line without an error. The /C switch capitalizes the
- returned string.
-
-
- *### Mono [CONFIG/BATCH]
- *
- Set a 25 line monochrome screen. [Return]
-
- Mono 1.0
-
- Performs a mode 7 reset of the display adapter using Interrupt 10H Function 0.
- This works in a display independent way. Use this command only if a monochrome
- monitor is installed.
-
-
- *### Mouse [BATCH]
- *
- Determine if a mouse is present and reset both software and hardware for it.
- [Return]
-
- Mouse 2.2 2.3
-
- Mouse Exit ErrorLevels
- ---------------------------------------------
- 0 Either hardware or driver are not installed
- Else Installed (number of buttons)
-
- Performs an Interrupt 33H Function 0 reset to get the driver status. This
- command requires DOS version 3.0 or higher.
-
-
- *### Now [BATCH]
- *
- Display the current date. [Return]
-
- Now DateFormat [/Q] [/@EnVar] 2.2 2.43
-
- The DateFormat characters are given below. This format is an extended version
- of that used in WordPerfect date codes. Non-number characters are transferred
- directly. The string is displayed using the current colors.
-
- Now Command Date Format Characters
- Character Meaning
- ---------------------------------------------
- 1 Day of the Month
- 2 Month (number)
- 3 Month (word)
- 4 Year (all four digits)
- 5 Year (last two digits)
- 6 Day of the Week (word)
- 7 Hour (24-hour clock)
- 8 Hour (12-hour clock)
- 9 Minute
- % ! $ Used before a number will: Pad numbers < 10 with a
- leading zero (!
- or %) or space ($), or abbreviate either the month or
- day of the week.
- # Used before a number will display that number.
- &1 &2 &3 &4 &5 &9 Insert country specific string separators. See the
- Country command
- for the string inserted.
-
- Examples (USA):
- 3 1, 4 December 25, 1994
- !6 !3 1,4 Sun Dec 25, 1994
- !2/!1/5 (6) 01/01/95 (Sunday)
- $2/$1/5 (%6) 1/ 1/95 (Sun)
- 8&5%9 0 10:55 am
- 5!2!1!7.!9 94122510.55
-
- If you desire the Day of Week or Month strings used in the Now command in
- another language, contact the author for a customized version of CFG.
-
-
- *### P5 [CONFIG/BATCH]
- *
- Return information about the Intel Pentium processor. [Return]
-
- P5 SubCommandName 2.41 2.43
-
- The following are valid SubCommandNames: FDIV, Model, Off, On, Step. Each
- SubCommandName may be abbreviated as desired. An ErrorLevel of 0 is returned on
- non-Pentium processors. Test for a Pentium using the CPU command first.
-
- * FDIVFDIVF: Performs the following calculation using floating point math:
- ((X/Y)*Y)-X, with X=4,195,835 and Y=3,145,727 (the two most notorious
- "magic numbers"). Returns an ErrorLevel of 1 for an error-free Pentium
- and 2 for a Pentium with the FDIV bug.
- * Model: Returns an ErrorLevel equal to the model number reported by the
- Pentium processor, using the CPUID instruction. The table below is the
- current estimation of what this SubCommand will return. If the "Verified"
- column is "Yes", then I have confirmed the result is correct. Please let
- me know if you have an update to this table.
- * Off/On: Enables and disables the Pentium floating point unit (FPU). Use
- this as a temporary work-around for early Pentiums that have the FDIV bug.
- The method used clears and sets status bits in both DOS low memory and on
- the processor itself. Significantly, this method may fail if the
- processor is already in Virtual 8086 Mode due to emulation. If you use
- the Off SubCommand, place the appropriate DEVICE line in CONFIG.SYS before
- all other DEVICE lines, including _*all*_ memory managers.
- * Step: Returns an ErrorLevel equal to the stepping level reported by the
- Pentium processor using the CPUID instruction.
-
- P5 Command Stepping Information
- Model Number Processor Verified Stepping Level With FDIV Fixed
- ---------------------------------------------
- 0 Unknown N/A N/A
- 1 P60/P66 No 7
- 2 P90 Yes 4
- 3 P100 No Unknown
- 4 P75 No Unknown
-
-
-
- *### Page [CONFIG/BATCH]
- *
- Select/determine the active video display page. [Return]
-
- Page [n] 2.0
-
- where "n" corresponds to the desired video display page. If "n" is omitted, no
- page change occurs. This command always returns an ErrorLevel corresponding to
- the current display page. For modes 0 and 1, pages 0-7 are valid. For modes 2
- and 3, pages 0-3 are valid. If anything else is specified on the command line,
- no page change occurs.
-
- Note that some programs write by default to page zero.
-
-
- *### Pause [CONFIG/BATCH]
- *
- Suspend execution after printing a prompt message on the screen. [Return]
-
- Pause 1.0
-
- Pressing any key resumes execution. The standard prompt is "CFG 2.43 Pause -
- Press any key to continue...". Use EchoPause to display a customized pause
- message, KeyPause for optional pausing or WaitFor for timed pausing.
-
-
- *### Print [BATCH]
- *
- Determine if the DOS Print command has been installed. [Return]
-
- Print 2.2
-
- Print Exit ErrorLevels
- ---------------------------------------------
- Else Number of files in print queue
- 253 Error in PRINT.COM
- 254 Not installed, but not OK to install
- 255 Not installed
-
- This command requires DOS version 3.0 or higher.
-
-
- *### PrintEcho [CONFIG/BATCH]
- *
- Controls DOS print echo operation. [Return]
-
- PrintEcho SubCommandName 2.4
-
- PrintEcho Exit ErrorLevels
- ---------------------------------------------
- 0 Disabled
- 1 Enabled
-
- NOTE: Uses undocumented information.
-
- Valid SubCommandNames are: Off, On, Status, Toggle. Each SubCommandName may be
- abbreviated as desired, but must be unique.
-
- * Off and On: Turn the DOS print echo function on and off by changing its
- status byte in the DOS data area. A status message is provided for each
- change in state.
- * Status: Reports the current DOS print echo state.
- * Toggle: Toggles the DOS print echo function from its previous state. A
- status message is provided for the current state.
-
- This command is available for MS-DOS Versions 3.1 through 6.22.
-
- The DOS print echo function is toggled on and off using Ctrl-PrtScr or Ctrl-P.
- If on, DOS will echo all characters displayed on the screen using DOS functions
- to PRN (LPT1). Note that this function uses undocumented information but has
- been tested for MS-DOS versions 3.1 through 6.22.
-
-
- *### Printer [BATCH]
- *
- Determine the status of the printer. [Return]
-
- Printer [n] 2.2
-
- Printer Exit ErrorLevels
- ---------------------------------------------
- 0 Printer ready
- 1 Printer time-out or device fault
- 2 Out of paper
-
- where "n" represents the printer number (1-3). If "n" is omitted or is out of
- range, the PRN (LPT1) device is assumed. The ErrorLevels are additive.
-
-
- *### Protected [BATCH]
- *
- Determine if 80286+ processor is in protected mode. [Return]
-
- Protected 2.0 2.2
-
- Protected Exit ErrorLevels
- ---------------------------------------------
- 0 Real mode
- 1 Protected mode
-
- Calls the CPU command then determines if the processor protected mode flag is
- set for 80286+ processors.
-
-
- *### PrtScr [CONFIG/BATCH]
- *
- Print the screen or controls print screen operation. [Return]
-
- PrtScr SubCommandName [/F] 2.0 2.2 2.3 2.4 2.43
-
- PrtScr Exit ErrorLevels
- ---------------------------------------------
- 0 Disabled
- 1 Enabled
- 255 Last print screen encountered error
-
- Valid SubCommandNames are: Off, On, Print, Status, Toggle. Each SubCommandName
- may be abbreviated as desired, but must be unique.
-
- * Off and On: Turn the BIOS interrupt function on and off by changing its
- status byte in the BIOS data area. A status message is provided for each
- change in state.
- * Print: Prints the current screen using BIOS Interrupt 5. A form feed is
- appended if the /F Form Feed switch is used.
- * Status: Reports the current print screen interrupt status.
- * Toggle: Toggles the BIOS interrupt function from its previous state. A
- status message is provided for the current state.
-
- On receipt of a Print Screen Interrupt 5, the BIOS bases its action on the
- status byte at 0040:0100. If the byte indicates that a print screen is
- currently in progress, the BIOS aborts the new request. This allows control of
- the print screen Interrupt 5 without a memory resident program.
-
-
- *### RamDrive [BATCH]
- *
- Detect if the specified drive is a ramdrive or search for one. [Return]
-
- RamDrive [/S] [d:] [/Q] [/@EnVar] 2.0 2.1
-
- RamDrive Exit ErrorLevels
- ---------------------------------------------
- Without /S 0 Drive is not a ramdrive
- 1 Drive is a ramdrive
- With /S 0 Ramdrive not found
- Else Ramdrive found (A:=1, B:=2, etc.)
-
- This command has several variations. If "d:" is specified, that drive is
- tested. If "d:" is omitted, the default drive is tested.
-
- If the /S switch is specified, a search is performed for the first ramdrive. If
- "d:" is also specified, the search starts with that drive and moves up the drive
- letter chain. If "d:" is not specified, the search starts with the D: drive.
- The search stops when the first ramdrive is found or the first nonexistent drive
- letter is encountered. DriveExist is called to determine if a drive exists.
-
- The ASCII drive specification is written to DOS StdOut only if the /S switch is
- used. The /Q and /@EnVar switches are functional only when /S is also used.
-
- This command searches for a ramdrive in a manner that is independent of finding
- a specific volume name which can be easily be changed. Since there is no
- official way of detecting a ramdrive, this command makes a determination by
- searching for three characteristic features: The drive is non-removable, has
- only one FAT and has a cluster size of one sector. If the first and at least
- one of the last two are true, the drive is considered to be a ramdrive. The
- tests are not completely foolproof. The following ramdrives have been tested to
- date and are recognized as valid:
-
- Microsoft Vdisk/RamDrive, Ziff-Davis XpanDisk, Qualitas 386disk, PC-Kwik
- RamDrive.
-
- Let me know of others which pass or fail the test.
-
- Note that a ramdrive compressed with DoubleSpace, Stacker, SuperStor, Squish or
- similar product is not recognized unless the uncompressed drive is tested.
-
-
- *### RandomFile [BATCH]
- *
- Create a unique random file name in the specified directory. [Return]
-
- RandomFile [d:][path] [/Q] [/@EnVar] [/S] 2.1 2.2
-
- RandomFile Exit ErrorLevels
- ---------------------------------------------
- 0 Successful
- 1 Invalid DOS version
- 2 DOS Error: File not found
- 3 DOS Error: Path not found
- 4 DOS Error: Too many open files (no handles available)
- 5 DOS Error: Access denied
- 6 DOS Error: Invalid handle
-
- This command creates a randomly named eight letter file name (with no extension)
- in the specified directory (path) using DOS Interrupt 21H Function 5AH. If a
- path is specified without a drive letter, the default drive letter is added to
- the start of the path. If no path is specified, the default drive and directory
- is used. The full path, including "." and "..", is resolved using the Dir
- command. Note the precautions given for this command above. The command
- normally deletes the file upon completion. If the /S switch is specified, the
- file is not deleted. This command requires DOS version 3.0 or higher.
-
- The RandomFile command is useful for the creation of temporary files that have a
- unique name. This guarantees that a filename conflict will not occur.
-
-
- *### Rem [CONFIG]
- *
- Indicate the use of descriptive comments in the CONFIG.SYS file. [Return]
-
- Rem [String] 1.1
-
- This allows the entry of remarks in CONFIG.SYS for all DOS versions without
- generating errors.
-
- REM is implemented in DOS version 5.0+, but is not available in earlier
- versions. For people who need to maintain standard machine configurations, this
- can be an impediment to clear documentation. While it slows CONFIG.SYS
- execution slightly, this is the best that can be done (easily) for DOS versions
- prior to 5.0.
-
-
- *### RenDir [BATCH]
- *
- Rename a directory. [Return]
-
- RenDir OldName NewName 2.0
-
- RenDir Exit ErrorLevels
- ---------------------------------------------
- 0 No errors
- 255 DOS error or DOSmajor < 3
-
- This command requires DOS version 3.0 or higher. Include the complete path for
- both old and new directory names. The path is not required if the directory
- being renamed is off the default directory. The DOS functions used cannot
- rename the drive's current directory.
-
-
- *### Right [BATCH]
- *
- Return the right most "n" characters from String. [Return]
-
- Right n String [/Q] [/@EnVar] [/C] 2.2 2.32
-
- where "n" is a decimal number indicating the number of characters to return from
- String, counting from the right. The /C switch capitalizes the returned string.
-
-
- *### ROMdate [BATCH]
- *
- Display the date of the ROM BIOS. [Return]
-
- ROMdate [/Q] [/@EnVar] 2.0 2.1
-
- The displayed date is the string of characters found at F000:FFF5 in memory.
- Not all BIOS may have the date at this location.
-
-
- *### ROMmodel [BATCH]
- *
- Display the model bytes of the ROM BIOS. [Return]
-
- ROMmodel [/Q] [/@EnVar] 2.0
-
- The displayed bytes are in hexadecimal. If the system supports Interrupt 15H
- Function C0H, then the model, submodel and BIOS revision bytes of the ROM
- configuration table are displayed. If the system does not support this call,
- the machine model byte at F000:FFFE is displayed. The exit ErrorLevel is equal
- to the model byte.
-
-
- *### RootDir [BATCH]
- *
- Determine the file capacity characteristics of the root directory. [Return]
-
- RootDir SubCommandName d: [/Q] [/@EnVar] 2.2
-
- where "d:" is the desired drive. The following are valid SubCommandNames:
- Total, Free, Used. Each SubCommandName may be abbreviated as desired. Error
- messages are displayed if the routine fails. This command is useful to
- determine if a floppy root directory has enough space to hold a specific number
- of file entries.
-
- * Free: Returns the number of unused root directory entries.
- * Total: Returns the total capacity of the root directory.
- * Used: Returns the number of used root directory entries.
-
-
- *### Rows [BATCH]
- *
- Determine the number of displayed rows. [Return]
-
- Rows 2.0
-
- The returned level is based on the value stored in the BIOS data area.
-
-
- *### Share [BATCH]
- *
- Determine if SHARE.EXE is installed. [Return]
-
- Share 2.0
-
- Share Exit ErrorLevels
- ---------------------------------------------
- 0 Not installed, OK to install
- 1 Not installed, not OK to install
- 2 Installed
- 255 Invalid DOS version
-
- The command executes Interrupt 2FH Function 10H Subfunction 0. Note that if DOS
- 4.01 SHARE was automatically loaded due to large disk volumes, file sharing is
- in an inactive state until this call is made. Share reports installed in a
- Windows DOS session with VSHARE.386 installed. This command requires DOS
- version 3.0 or higher.
-
-
- *### Shift-AND [BATCH]
- *
- Determine if desired shift keys are depressed. [Return]
-
- Shift-AND [Alt] [Ctrl] [Shift] 2.0
-
- Shift-AND Exit ErrorLevels
- ---------------------------------------------
- 0 Some or none of the keys listed are depressed
- 1 All keys listed are depressed
-
- The routine will work with either of the paired keys on the keyboard. The
- requested keys are considered to be "AND"ed, meaning all keys listed must be
- depressed. The arguments may be shortened as desired, but must always be
- separated by at least one space. Use the Shift-OR command to do an OR
- comparison of the shift keys. Use the ShiftState command for identifying
- individual shift keys.
-
-
- *### ShiftLock [BATCH]
- *
- Determine status of keyboard NumLock, CapsLock, ScrollLock and Insert. [Return]
-
- ShiftLock [SubCommandName] 2.0
-
- ShiftLock Exit ErrorLevels
- ---------------------------------------------
- With SubCommandName 0 Lock state is off
- 1 Lock state is on
- Without SubCommandName 0 No lock states are on
- 1 ScrollLock is on
- 2 NumLock is on
- 4 CapsLock is on
- 8 Insert is on
-
- The following are valid SubCommandNames: Caps, Insert, Num, Scroll. Each
- SubCommandName may be abbreviated as desired.
-
- Issued without a SubCommandName, the command returns the ErrorLevels noted
- above. The ErrorLevel is additive and can be in the range of 0 to 15.
-
-
- *### Shift-OR [BATCH]
- *
- Determine if desired shift keys are depressed. [Return]
-
- Shift-OR [Alt] [Ctrl] [Shift] 2.0
-
- Shift-OR Exit ErrorLevels
- ---------------------------------------------
- 0 None of the keys listed are depressed
- 1 At least one of the keys listed is depressed
-
- The routine will work with either of the paired keys on the keyboard. The
- requested keys are considered to be "OR"ed, meaning at least one of the keys
- listed must be depressed. The arguments may be shortened as desired, but must
- always be separated by at least one space. Use the Shift-AND command to do an
- AND comparison of the shift keys. Use the ShiftState command for identifying
- individual shift keys.
-
-
- *### ShiftState [BATCH]
- *
- Determine which shift keys are depressed. [Return]
-
- ShiftState 2.0 2.2
-
- ShiftState Exit ErrorLevels
- ---------------------------------------------
- 0 None of the shift keys are depressed
- 1 Right shift
- 2 Left shift
- 4 Right ctrl
- 8 Left ctrl
- 16 Right alt
- 32 Left alt
-
- The ErrorLevel is additive and can be in the range of 0 to 63. Use the Shift-OR
- command to do an OR comparison of the shift keys. Use the Shift-AND command to
- do an AND comparison of the shift keys.
-
-
- *### Stacker [BATCH]
- *
- Identify the presence of a Stacker device driver in memory and optionally
- determine if a specific drive is a Stacker volume. [Return]
-
- Stacker [d:] 2.0 2.1
-
- Stacker Exit ErrorLevels
- ---------------------------------------------
- Without argument 0 Not installed
- Else Installed [(32 * major) + minor]
- With argument 0 Not a Stacker volume
- 1 Valid Stacker volume
- 255 Invalid drive letter
-
- where "d:" represents an optional drive letter to be checked as being a Stacker
- volume. When run without command line arguments, a driver status message is
- displayed. For example, the version 2.01 driver will return an ErrorLevel of
- 65.
-
- If any character is included on the command line, CFG checks to see if it is a
- valid drive letter from A to Z. For legal drive letters, CFG checks to see if
- that drive corresponds to a valid Stacker volume. The appropriate message is
- displayed in each case. The drive does not have to be a valid DOS drive to be
- checked. The Stacker device driver consults an internal table to determine if
- the drive is a Stacker volume. If a removable disk drive is checked (such as a
- floppy disk or a Bernoulli), the drive must be mounted in order to provide a
- valid response. A reserved removable drive that does not have a volume mounted
- will return an invalid response.
-
-
- *### TaskSwitch [BATCH]
- *
- Determine whether a task switcher is installed and enabled. [Return]
-
- TaskSwitch [/Q] [/@EnVar] 2.2
-
- TaskSwitch Exit ErrorLevels
- ---------------------------------------------
- 0 Not installed
- 1 Installed (disabled)
- 2 Installed (enabled)
-
- Determines if any task switcher meeting the DOS 5.0 specification is installed.
- If it is, the name of the task switcher is displayed.
-
-
- *### Toggle [CONFIG/BATCH]
- *
- Modifies the current shift state of the keyboard NumLock, CapsLock or ScrollLock
- keys. [Return]
-
- Toggle [N[+|-]] [C[+|-]] [S[+|-]] [/S] 2.0 2.32
-
- where "N" represents the NumLock state, "C" represents the CapsLock state and
- "S" represents the ScrollLock state. Toggle changes the current shift state of
- the keyboard NumLock, CapsLock or ScrollLock keys when used with just the
- letters. The state of the three keys is explicitly turned on or off if the
- optional + or - argument is supplied. The /S switch will write to the keyboard
- port to synchronize the keyboard LEDs of systems that have a BIOS that does not
- automatically perform the update.
-
-
- *### Tones [CONFIG/BATCH]
- *
- Programs the system's speaker port to emit a rising (Upward) or falling
- (Downward) series of tones. [Return]
-
- Tones SubCommandName 1.0 1.1 2.2
-
- The following are valid SubCommandNames: Down, Up, Over, Under. Each
- SubCommandName may be abbreviated as desired. Error messages are displayed if
- the routine fails. Over calls Up then Down. Under calls Down then Up.
-
-
- *### Typematic [CONFIG/BATCH]
- *
- Sets the keyboard typematic rate and delay. [Return]
-
- Typematic r,d | SubCommandName 2.0 2.42
-
- Typematic Exit ErrorLevels
- ---------------------------------------------
- 0 No errors
- 255 Invalid value
-
- where "r" corresponds to the typematic rate (1-32) and "d" corresponds to the
- delay (1-4) in 1/4 second increments. The following are valid SubCommandNames:
- Default, Fast, Slow. Values outside the allowed ranges are reset to the closest
- limiting value. An ErrorLevel of 255 indicates that this was done.
-
- NOTE: Some keyboards do not recognize this command.
-
- * Default: Equivalent to settings of 20,2 (standard boot values).
- * Fast: Equivalent to settings of 32,1 (fastest repeat rate, shortest
- delay).
- * Slow: Equivalent to settings of 1,4 (slowest repeat rate, longest delay).
-
- The values that the BIOS accepts are divisors that cannot be easily translated
- into characters per second. The following table lists some of the rate values
- and the approximate number of characters per second (CPS).
-
- Typematic Command Keyboard Rates
- Rate CPS Rate CPS Rate CPS Rate CPS
- ---------------------------------------------
- 1 2 12 5 20 10 28 20
- 6 3 14 6 22 12 30 24
- 9 4 17 8 25 16 32 30
-
-
- *### Upper [BATCH]
- *
- Return String all in upper case. [Return]
-
- Upper String [/Q] [/@EnVar] 2.2
-
- If String starts with a double quote ["], the double quote is deleted but
- leading separators are not removed. Otherwise, all leading white space is
- removed from String. A closing double quote should not be used.
-
-
- *### Verify [BATCH]
- *
- Return status of DOS Verify option. [Return]
-
- Verify 2.0
-
- Verify Exit ErrorLevels
- ---------------------------------------------
- 0 Off
- 1 On
-
-
- *### Version [BATCH]
- *
- Determine the version of various drivers/programs. [Return]
-
- Version SubCommandName 2.2
-
- Version Exit ErrorLevels
- ---------------------------------------------
- All 0 Not installed
- EMS/VCPI/XMS Else (16 * major) + minor
- DPMI Else (100 * major) + minor
- DOS Else (32 * major) + minor
- CFG Else (100 * (major - 2)) + minor
-
- Valid SubCommandNames are: CFG, DOS, DPMI, EMS, VCPI, XMS. The DOS SubCommand
- returns the same information as the DOSversion command, including the /T switch.
-
- * DPMI - DOS Protected-Mode Interface
- * EMS - Expanded Memory Specification
- * VCPI - Virtual Control Program Interface
- * XMS - Extended Memory Specification
-
-
- *### VGA25 [CONFIG/BATCH]
- *
- Set a 25 line VGA screen. [Return]
-
- VGA25 [/C] 1.0 2.0 2.2 2.4
-
- Forces the use of the display adapter's internal 8x16 font. Interrupt 10H
- Function 11H Subfunction 14H performs an adapter mode reset when it executes.
- This works on VGA in a display independent way. The /C switch clears the screen
- after switching modes if ANSI is installed to set the screen color.
-
- This command is in effect only for video modes 0-3.
-
-
- *### VGA43 [CONFIG/BATCH]
- *
- Set a 43 line VGA screen. [Return]
-
- VGA43 [/C] 1.0 2.0 2.4
-
- Forces the use of the display adapter's internal 8x14 font. Interrupt 10H
- Function 11H Subfunction 11H performs an adapter mode reset when it executes.
- This works on VGA in a display independent way. The /C switch clears the screen
- after switching modes if ANSI is installed to set the screen color.
-
- This command is in effect only for video modes 0-3.
-
-
- *### VGA50 [CONFIG/BATCH]
- *
- Set a 50 line VGA screen. [Return]
-
- VGA50 [/C] 1.0 2.0 2.4
-
- Forces the use of the display adapter's internal 8x8 font. Interrupt 10H
- Function 11H Subfunction 12H performs an adapter mode reset when it executes.
- This works on VGA in a display independent way. The /C switch clears the screen
- after switching modes if ANSI is installed to set the screen color.
-
- This command is in effect only for video modes 0-3.
-
-
- *### VideoMode [BATCH]
- *
- Determine/set the current video mode. [Return]
-
- VideoMode [n] 2.0 2.3
-
- CAUTION: Use this command with care. Your video system hardware must support
- the video mode being set.
-
- If the optional hexadecimal number "n" is added, the designated video mode is
- set. The returned ErrorLevel is based on the value stored in the BIOS data
- area.
-
-
- *### WaitFor [CONFIG/BATCH]
- *
- Delay program execution for the number of minutes and seconds given on the
- command line. [Return]
-
- WaitFor [mm:]ss [/N] 1.0 2.2 2.32
-
- WaitFor Exit ErrorLevels
- ---------------------------------------------
- 0 Timed out as requested
- 1 Exited prior to time out due to key press
- 255 Format error
-
- where "mm" is the delay time in minutes and "ss" is in seconds. If a single
- number is on the command line, it is assumed to be seconds. The default is one
- second. The /N switch tells CFG to not flush the keyboard buffer prior to
- executing the command.
-
- CFG only checks for a ":" between the minutes and seconds. Any other character
- or separator will cause the minutes value to be treated as seconds and the
- seconds value to be ignored. Spaces should not be used on either side of the
- colon.
-
- Pressing any key during the wait period will cancel the wait. CFG checks the
- keyboard buffer 18 times a second for a key press.
-
-
- *### WaitTo [CONFIG/BATCH]
- *
- Delay execution until the specified time of day. [Return]
-
- WaitTo hh:mm[:ss] [/N] 2.0 2.2
-
- WaitTo Exit ErrorLevels
- ---------------------------------------------
- 0 Timed out as requested
- 1 Exited prior to time out due to key press
- 255 Format error
-
- where "hh" is the hour (0-23), "mm" is the minute (0-59) and "ss" is the second
- (0-59). If the seconds are omitted, 0 is assumed. The /N switch tells CFG to
- not flush the keyboard buffer prior to executing the command.
-
- Pressing any key during the wait period will cancel the wait. If a key is
- waiting in the buffer and /N is not specified, the command immediately ends.
-
-
- *### WarmBoot [BATCH]
- *
- Perform a keyboard (Ctrl-Alt-Delete) system reset. [Return]
-
- WarmBoot SubCommandName [/V] 2.0 2.1 2.3 2.32 2.42
-
- The following are valid SubCommandNames: WaitFor, WaitTo, Verify. Each
- SubCommandName may be abbreviated as desired. Error messages are displayed if
- the routine fails.
-
- All disk buffers that may not yet be written are flushed to disk via Interrupt
- 21H Function 0DH (Disk Reset) prior to system reset. EMM386 is shut down prior
- to system restart. For 8086/8088 processors only, the command jumps to
- FFFF:0000 after setting the warm boot flag in the BIOS data area. For 80286+
- processors, the system is reset via the keyboard controller for reliability.
- The /V Verify switch is available for use with the WaitFor and WaitTo
- subcommands. Use the ColdBoot command to simulate a power-on reset.
-
- * WaitFor: Executes the WaitFor command first. All command line options of
- the WaitFor command are available.
- * WaitTo: Executes the WaitTo command first. All command line options of
- the WaitTo command are available.
- * Verify: Prompt before rebooting.
-
-
- *### Window [CONFIG/BATCH]
- *
- Draw boxes on the screen in the desired color. [Return]
-
- Window r c w h [b ["Fore [on] Back"] 2.0
-
- where "r" is the top row of the box, "c" is the left column of the box "w" is
- the box width, "h" is the box height and "b" is the box type (0-2). The color
- must be enclosed by double quotation marks and follows the same requirements as
- the Cls command. The top left screen corner is 1 1.
-
- Three box types are available. For b=0, the box is drawn without borders. For
- b=1, the box has single-line borders. For b=2, the box has double-line borders.
- If "b" is omitted, b=0 is assumed. A value for "b" must be specified in order
- to include a color. If a color is not specified, the current screen colors are
- used.
-
- The smallest window allowed is 2 characters in width and height. The area
- inside the border is blanked with spaces. Text can be added to the frame using
- the Locate and Cecho commands.
-
-
- *### Windows [BATCH]
- *
- Determine if Microsoft Windows is currently running. [Return]
-
- Windows 2.1
-
- Windows Exit ErrorLevels
- ---------------------------------------------
- 0 Windows is not running
- 1 Windows is running in either Real or Standard mode
- 2 Windows is running in Enhanced mode
-
-
- *### ZeroFile [BATCH]
- *
- Creates or truncates a file to a length of zero. [Return]
-
- ZeroFile [/T] Filename 2.2
-
- ZeroFile Exit ErrorLevels
- ---------------------------------------------
- 0 Successful (file did not previously exist)
- 1 Successful (file existed and was truncated)
- With error ErrorLevel is the DOS error code (1-13)
-
- This command will create a zero-byte file with the desired name. If the file
- already exists, the /T Truncate switch must be specified for CFG to truncate it.
- This command is useful to create zero-byte files to serve as flags for batch
- files to store information without an environment variable. A zero-byte file
- takes up no disk storage space other than its directory entry. To create a file
- with a unique random name, use the RandomFile command.
-
-
- Appendix A: Problems and Solutions
-
-
- [Return]
- I pass multiple CFG commands to a batch file, but they do not execute or cause
- an error.
-
- * This occurs when you use the MultiCommand separator with replaceable DOS
- batch file parameters. DOS treats the MultiCommand separator semicolon as
- white space and deletes it while passing the parameter. This is what
- causes the errors. The solution is to use the semicolon in the called
- batch file or set up the CFG commands on separate lines.
-
-
- I try to save environment output in a DOS box under Windows, but nothing ever
- appears.
-
- * Specify "/2" on the command line. Your output is going into the master
- environment by default, not the secondary environment you want. See the
- "DOS" section.
-
-
- I get strange output from the Nowcommand when using multiple percent signs in my
- command string.
-
- * Use the "!" character in place of the "%" characters in this instance. The
- DOS batch interpreter is interpreting the characters between the percent
- signs as a potential environment variable name. Chances are that such a
- name does not exist, so DOS is deleting the percent signs and intervening
- characters before CFG ever receives the string.
-
-
- Appendix B: Bibliography
-
-
- [Return]
- Ralph Brown and Jim Kyle, _PC Interrupts_, Second Edition, Reading MA:
- Addison-Wesley, 1994. ISBN 0-201-62485-0.
-
- Geoff Chappell, _DOS Internals_, Reading MA: Addison-Wesley, 1993. ISBN
- 0-201-60835-9.
-
- Ray Duncan (Ed), _The MS-DOS Encyclopedia_, Redmond WA: Microsoft Press, 1988
- (out of print). ISBN 1-55615-174-8.
-
- Frank Van Gilluwe, _Undocumented PC_, Reading MA: Addison-Wesley, 1994. ISBN
- 0-201-62277-7.
-
- Microsoft Corporation, _Microsoft MS-DOS Programmer's Reference_, Second
- Edition, Redmond WA: Microsoft Press, 1993. ISBN 1-55615-546-8.
-
- Andrew Schulman, et al., _Undocumented DOS_, Second Edition, Reading MA:
- Addison-Wesley, 1994. ISBN 0-201-63287-X.
-
-
- There have been several other books I have use that have proved to be valuable:
-
- Ray Duncan, _Power Programming with Microsoft Macro Assembler_, Redmond WA:
- Microsoft Press, 1992. ISBN 1-55615-256-6.
-
- Harley Hahn, _Assembler Inside and Out_, Berkeley CA: McGraw-Hill, 1992. ISBN
- 0-07-881842-7.
-
- Robert Hummel, _Assembly Language Lab Notes_, Emeryville CA: Ziff-Davis Press,
- 1992. ISBN 1-56276-059-9.
-
- Peter Norton and Richard Wilton, _The New Peter Norton Programmer's Guide to the
- IBM PC & PS/2_, Second Edition, Redmond WA: Microsoft Press, 1988 (out of
- print). ISBN 1-55615-131-4.
-
- Marcus Johnson, _Assembly Language: For Real Programmers Only_, Carmel IN: Sams
- Publishing, 1993. ISBN 0-672-48470-6.
-
- Allen L. Wyatt, Sr., _Advanced Assembly Language_, Carmel IN: Que Corporation,
- 1992. ISBN 1-56529-037-2.
-
-
- With these, you too can write a program like CFG. Have fun.
-
-
- Appendix C: Revision History
-
-
-
- Version 1.0 -- 28 August 1992 [Return]
-
- * First public version. Supported Beep, Cls, ComHide, ComSwap, Echo,
- EchoPause, EGA25, EGA43, KeyPause, LptHide, LptSwap, Mono, Pause, Tones,
- VGA25, VGA43, VGA50 and WaitFor commands.
-
- Version 1.1 -- 11 September 1992 [Return]
-
- * Revised command line parsing. Recognizes the plus sign, equals sign and
- comma as separators.
- * Revised the method for detecting ANSI. Previously, the ANSI Device Status
- Report sequence was used. This proved unreliable on some systems when
- StdIn did not reflect a valid Cursor Position Report from ANSI. The new
- method uses cursor positioning sequences.
-
- * Cls: Corrected a bug that caused bright colors to sometimes be displayed
- in low intensity, removed a mismatch between the DOS and ANSI color
- values, and added color parsing error messages.
- * Tones: Corrected error which made the command unavailable.
-
- * Added the Color, IACAfill and Rem commands as well as the IACAread
- companion program.
-
- Version 2.0 -- 1 January 1993 [Return]
-
- * Program is now dual mode with a .COM extension. The separate IACAread
- program is no longer required since that command is incorporated from the
- command line.
- * Improved error handling and reporting.
- * Deleted the plus sign from the list of separator characters.
-
- * Beep: Optionally allows specification of frequency and length of sound,
- with the ability to do multiple sounds from a single command line.
- * Cls: Sets the screen border color to that of the background and restores
- the cursor to its previous size.
- * EGA25, EGA43, VGA25, VGA43 and VGA50: These screen mode commands now
- optionally issue a ANSI escape sequence to clear the screen after the mode
- change to reset the screen color if the /C switch is specified.
- * KeyPause: Also sets an ErrorLevel.
-
- * Added the AM, ANSI, ASCII, Blink, Border, Break, CanCopy, Cecho, ColdBoot,
- Cols, Compare, CoProc, CPU, Cursor, Day, DESQview, DirExist, Display,
- DOSmajor, DOSminor, DOSversion, Drive, DriveExist, DriveReady, DriveSize,
- DriveSpace, EMSversion, Env, FileDTC, FileExist, Files, FileSize,
- FileText, FullYear, GetKey, Hour, IACAread, Intense, IsVol, Locate,
- Memory, Minute, Month, Page, PM, Protected, PrtScr, RamDrive, RenDir,
- ROMdate, ROMmodel, Rows, Second, Share, Shift-AND, ShiftLock, Shift-OR,
- ShiftState, StacInst, Toggle, Typematic, Verify, VideoMode, WaitTo,
- WarmBoot, WeekDay, Window and Year commands.
-
- *** Mediterranean/Red Sea Deployment 1993 *** Versions 2.1 and 2.2 were written
- while deployed aboard USS Theodore Roosevelt (CVN 71) during support missions
- for the United Nations sanctioned NATO Operations Provide Promise and Deny
- Flight in Bosnia-Herzegovina and Operation Sharp Guard in the Adriatic Sea. We
- also participated in Operation Southern Watch (southern Iraq no-fly zone) from
- the Red Sea. The deployment was 11 March to 8 September 1993.
-
- Version 2.1 --- 12 May 1993 [Return]
-
- This version was released for Bantam Books "PC Magazine DOS Power Tools 6.0" by
- Paul Somerson.
-
- * Added extended ErrorLevel reporting via the /E+ switch. The ErrorLevel
- which would be returned is now displayable from CONFIG.SYS.
- * The exit ErrorLevel is now automatically included as part of an error
- message display.
- * Invalid CommandNames and file names are now displayed for easier
- identification.
- * The Help system screen code was modified for VGA and monochrome systems.
-
- * ANSI: Corrected a bug which caused a false negative report if the cursor
- was already in the home position. If ANSI is not present, screen
- characters are now restored instead of erased. These changes extend to
- all commands which test for/use ANSI.
- * Cecho, Echo, EchoPause: Commands completely rewritten to correct a parsing
- error that would not correctly handle a carriage return/line feed
- sequence. The default tilde (~) format character can now be used from a
- batch file.
- * ColdBoot: Optionally prompts the user to verify the reboot if the /V
- Verify switch is used.
- * Env: Optionally finds the environment of the immediate parent process if
- the /P Parent switch is specified.
- * FileSize: Changed block calculation such that a partial block is added to
- the total number of blocks vice being ignored.
- * IACAfill: Unconditionally overwrites the IACA if the /O switch is
- specified.
- * IACAread: Optionally clears the IACA after reading if the /C switch is
- specified. This was nonfunctional in version 2.0.
- * RamDrive: The /A switch now writes the correct letter to StdOut, provides
- the correct ErrorLevel and corrects a bug which could hang the machine if
- an unoccupied removable drive was encountered during a /S search.
- * ROMdate: Displays all eight characters of the date for ROMs that have
- nonstandard date formats.
- * StacInst: Renamed "Stacker".
- * WarmBoot: See ColdBoot changes above.
- * WeekDay, Day, Month, Hour and Minute: All accept an optional parameter for
- direct comparison with the normal output.
-
- * Added the DS4, Help, KeyBoard, KeyBuffer, LastDrive, RandomFile and
- Windowscommands.
-
- Version 2.2 -- 10 November 1993 [Return]
-
- * Added the ability for the program to place its output directly into the DOS
- master environment and to directly manipulate environment strings. The
- /@EnVar switch must be specified. See the individual commands to
- determine support for this switch.
- * CommandName and SubCommandName parsing was completely rewritten for ease in
- future expansion. SubCommandNames may now be abbreviated to any number of
- characters. Invalid SubCommandNames are displayed for easier
- identification.
- * The /A ASCII output switch no longer has a global effect. All screen
- output is displayed unless the /Q Quiet switch is used. /Q has no effect
- on the Cecho, Echo and EchoPause commands.
- * The /Dn Divisor switch is now effective for all commands that return an
- ErrorLevel except for a few specific cases. The default divisor is 1.
- * The /, Comma switch adds commas every three places to displayed numbers.
-
- * Beep: Pressing any key while playing now ends the command. Added the /N
- No-Flush switch.
- * CoProc, CPU, Protected: Corrected a stack restoration problem in the Intel
- code which could possibly lock up the machine.
- * DOSversion: Added the /T True option. See Version command.
- * DriveVolume: Corrected handling of volume names longer than eight
- characters. It worked previously if the period was manually inserted
- between characters eight and nine.
- * EMSversion: Command deleted - added to Version command.
- * Env: Added the Clear, Fill, Reset and Set string SubCommands.
- * FileSize: Corrected block calculation for files larger than 64 KB.
- * FullYear: Corrected calculation for years greater than 1999.
- * GetKey: Corrected documentation to say function keys _must_ be preceded by
- an "F". Numbers without an "F" were interpreted as scan codes (as
- intended); only the documentation was in error. Added the Escape key and
- Ctrl-/Alt- letter key combinations to the parse list, the /C Case
- sensitive switch, the /S Show (display) switch, the "D:t,p" option and the
- "Sn" option. Standard separators are now parsed out.
- * IACAread: Rewritten to use standard program output routines.
- * IsVol: Renamed "DriveVolume".
- * Memory: Deleted the /R Report switch. A screen report is always made
- unless /Q is used. Exit ErrorLevel is now based on whether or not a
- decimal number is present after the SubCommandName. Added the High and
- UMB SubCommands. Changed the "Xpanded" SubCommandName to "Expanded".
- [Extensive rewrite]
- * PrtScr: Added control and indication of the DOS print echo.
- * RandomFile: Resolves "." and ".." using the Dir command.
- * ShiftState: Corrected bug which made function inoperative.
- * Tones: Added the Over and Under options. Made the tone length processor
- speed independent.
- * VGA25: Changed from issuing a mode 3 reset to using the display adapter's
- internal 8x16 font.
- * WaitFor: Checks the keyboard buffer for a key press each timer tick vice
- once each second. Added the /N No-Flush switch.
- * WaitTo: Added the /N No-Flush switch.
-
- * Added the Boot, CodePage, Country, Device, Dir, DosKey, FileDir, FileDrive,
- FileExt, FileName, Input, KeyFlush, KeyPress, KeyStuff, LastBoot, Left,
- Length, Lower, MachineName, Mid, Mouse, Now, Print, Printer, Right,
- RootDir, TaskSwitch, Upper, Version and ZeroFile commands.
-
- Version 2.3 -- 1 May 1994 [Return]
-
- * CFG is now multi-segmented (an EXE hiding in the COM file) in order to
- support further additions (and my sanity), using MASM 6.11 vice TASM 1.0.
- * CFG now has a MultiCommand mode that allows multiple CommandNames on a
- single command line. Each command must be separated by a semi-colon.
- * Switches are now not scanned within fully quoted text strings.
- * Added the /@EnVar switch "=" option to capitalize the associated EnVar.
- * Added the /Bn switch to establish the desired number system base to use for
- some commands.
- * Added to the /E switch: "@" option to place the output ErrorLevel in the
- "EL" environment variable, "!" option to specify which of the possible
- ErrorLevels to return in MultiCommand mode, "E" option to allow basic
- ErrorLevel display when all those other options are used.
- * Corrected a bug in the environment code if the low memory COMMAND.COM stub
- had been moved to the UMB area by a memory manager (like 386Max). [This
- was in the /1B search method.]
- * Changed the default method for locating the master environment. The /1
- switch specifies the primary or master environment. The /1A and /1B
- options control specific search methods. The /2 switch specifies the
- secondary or parent environment. The old /P switch is still valid, but
- the /2 switch will ensure future compatibility. See the DOS section for
- details.
- * CFG will now update both the master and parent environments, if desired.
- See the Global section for details.
- * Commas are now ignored while reading numbers on the command line unless
- specified in the command description.
-
- * ASCII: Added /Bn support.
- * Beep: Changed argument format. Tone and duration values are now separated
- by spaces; argument pairs are now separated by commas. This change is
- required for the multiple command format. The strict "no spaces" format
- is no longer required. Added /Bn support.
- * Cecho: /B Blink switch changed to /K to support multiple number bases.
- * ColdBoot: Added the WaitFor, WaitTo and Verify subcommands.
- * CoProc: Corrected error identifying an 80486DX as "not installed". Added
- Pentium identification.
- * CPU: Added Pentium identification.
- * Device: Changed format of the command to eliminate the confusing set of
- switches. New SubCommands are Exist, List and Rename. The /N and /R
- switches have been deleted.
- * Env: See environment changes above. Added the Caps SubCommand.
- * KeyPause: Corrected bug that would not return the desired ErrorLevel.
- * MachineName: Now correctly displays names with embedded spaces.
- * Memory: Corrected error that made the desired memory comparison
- inoperative. Added environment output and desired memory comparison for
- all subcommands.
- * Memory Main: Now bases calculation on location of CFG's PSP due to the EXE
- format.
- * Mouse: Changed ErrorLevel reporting. An error in the reference I used led
- me astray.
- * PrtScr: Added ErrorLevel reporting for previous system PrtScr error.
- * VideoMode: Added the option of setting the desired video mode.
- * WarmBoot: See ColdBoot.
-
- * Added the Add, And, Convert, Div, DOSlocation, DOSstartup, ErrorLevel,
- Lock, Mod, Mul, Not, Or, Sub and Xor commands.
-
- Version 2.31 -- 21 May 1994 [Return]
-
- * FileText: Corrected bug that always returned string not present. Added
- the /C Case switch for case insensitive searches.
-
- Version 2.32 -- 1 July 1994 [Return]
-
- * Added Internal Error checking. This should never happen, but it allows
- things to end a little bit more gracefully.
- * Corrected display of messages during the /1B environment search error exit.
- * Corrected failure to display "Out of Environment Space" error message.
- * Note 1: Corrected bugs in several commands which caused errors if they
- were not the last command on a line in MultiCommand mode.
- * Note 2: Corrected bugs in several commands which always returned strings
- capitalized.
-
- * ColdBoot: Revised reboot method for 286+ processors. The system is now
- more reliably reset via the keyboard controller.
- * DriveExist: Note 1.
- * DriveReady: Note 1.
- * DriveVolume: Added testing for invalid drive designation.
- * Env: Corrected bug which put the Fill SubCommand into a loop and disabled
- the Reset SubCommand. Fixed Set SubCommand.
- * FileDTC: Note 1.
- * Left: Notes 1 and 2. Added the /C switch.
- * Mid: Notes 1 and 2. Added the /C switch.
- * Right: Note 2. Added the /C switch.
- * Toggle: Corrected bug which incorrectly displayed lock status.
- * WaitFor: Added ErrorLevel return.
- * WarmBoot: See ColdBoot.
-
- Version 2.4 -- 1 October 1994 [Return]
-
- * CFG is now Shareware with a $25 registration fee. Please support
- shareware.
- * On-line Help now includes searchable access of the CFG.DOC file. See the
- Help command above for details. Quick Help is now a separate CFG.HLP file
- and includes a list of SubCommandNames. This allows a smaller executable
- and faster loading, especially when executed from CONFIG.SYS. Both files
- must be in the same directory as the CFG executable to be found.
- * The /P switch no longer specifies the secondary environment. Use the /2
- switch.
- * Note 3: Added the /@EnVar switch function to the arithmetic commands. The
- /Q Quiet switch is noted for completeness.
-
- * Add: Note 3.
- * And: Note 3.
- * Cecho: Corrected batch capitalization problem.
- * Div: Note 3.
- * EGA43: Now generates an error if you try to switch the video font size
- while in video mode 4 or above.
- * Env: Added the Save SubCommand. Now handles full environments better.
- * Help: See above.
- * KeyBuffer: Changed format of the command to standardize the options. New
- SubCommands are Set and Status.
- * LptSwap: Now swaps printer time-out values also.
- * Mod: Note 3.
- * Mul: Note 3.
- * Not: Note 3.
- * Or: Note 3.
- * PrtScr: Changed format of the command to eliminate the confusing set of
- options. New SubCommands are Off, On, Print, Status and Toggle. Moved
- DOS print echo control to the PrintEcho command.
- * Sub: Note 3.
- * VGA25, VGA43 and VGA50: See EGA43.
- * Xor: Note 3.
-
- * Added the ComBaud, ComSet, DriveID, FileLines, GamePort, LptSet and
- PrintEcho commands.
-
- Version 2.41 -- 28 December 1994 [Return]
-
- * Shifted the program documentation from WordPerfect 5.1 (DOS) to Microsoft
- Word for Windows 6.0c with Woody's Office POWER Pack (WOPR) 6.0c added.
- Registered users will now also receive this documentation on disk as a
- Word 6.0 file that includes color, all the special formatting and
- hypertext jumps to easily move around the document.
-
- * CPU: Corrected display of Pentium processor stepping level, model and
- family. Also see the P5 command.
-
- * Added the P5 command.
-
- Version 2.42 -- 15 May 1995 [Return]
-
- * Check out the new Batch command. It does some really* *neat stuff to make
- installation batch files easier to write.
- * The WinWord version of this documentation for registered users has received
- significant upgrades. The behind-the-scenes macros are much improved and
- powerful.
- * CFG now generates an error and terminates if it is run in an Upper Memory
- Block.
- * Note 4: Corrected a parsing error in some commands when numbers were
- separated only by commas.
- * Corrected a display problem where /E switch information would not be shown
- for some commands.
-
- * ColdBoot: Added code to shut down EMM386 prior to system restart.
- * Country: Improved error handling of invalid parameters.
- * ErrorLevel: Now accepts numbers in different number bases.
- * GetKey: Note 4 for D[:]t,p parameter.
- * Typematic: Added Default and Slow SubCommands. A command line parameter
- is now required. Illegal parameters are now reset to the maximum or
- minimum value allowed. An ErrorLevel of 255 indicates that this was done.
- The typematic settings are adjusted to these reset values vice being
- ignored. Note 4 for r,d parameters.
- * WarmBoot: See ColdBoot.
-
- * Added the Batch command.
-
- Version 2.43 -- 15 July 1995 [Return]
-
- * Enhanced the WinWord macros supporting this file.
- * The /Bnnumber base switch now accepts all values from 2 through 16, vice
- just 2, 8, 10 or 16.
- * Corrected minor display problem when testing for an ANSI driver when none
- is installed.
-
- * Env: Corrected Set subcommand to use mixed case vice capitalized EnVar
- value.
- * FileDTC: Changed ErrorLevel reporting to match the previous text
- description. The command now checks for all possible combinations of time
- and date.
- * Keyboard: Added the Disable, Enable and Status subcommands. The previous
- command functionality is in the Status subcommand. The Disable and Enable
- commands turn off all keyboard input, including the Ctrl-Alt-Delete reset.
- * Now: Added "!" as a alternative for "%". Multiple percent signs may be
- misinterpreted by the DOS batch processor as referring to an environment
- variable name. Individual %1, %2, etc. are taken for replacable command
- line parameters.
- * P5: Added the FDIV subcommand to positively identify Pentium processors
- with the FDIV bug.
- * PrtScr: Corrected disabled Print subcommand.
-
-
- Appendix D: Background Discussion
-
-
- [Return]
- CFG started as a pure DOS device driver. As such, versions 1.0 and 1.1 provided
- functionality from CONFIG.SYS only. I experimented with dual-mode programming
- to make version 2.0 provide a command line interface from DOS, expanding the
- program's scope significantly. Subsequent versions have expanded on both the
- CONFIG.SYS and command line utility commands available.
-
- Version 2.1 almost made it into Bantam's "DOS 6.0 Power Tools" except for the
- delays in the mail brought about by my 1993 deployment (2.0 was shipped).
- Several people received it directly based on specific requests. Version 2.2 was
- another significant expansion and improvement.
-
- Version 2.3 moved CFG into still another facet of executable programs in that it
- became a multi-segmented EXE program. The transition took a bit work (with some
- errors despite all my testing, sorry), but was necessary since I had to allow
- for up to 32KB of DOS, adequate stack space, program code and all data within
- 64KB. While version 2.2 fits, it was obvious there was no more room for
- expansion. Version 2.3 has lots of elbow room for continued expansion and
- improvement. Modular programming helps the space cram. The COM extension was
- retained for compatibility with CONFIG.SYS and batch files already written. DOS
- identifies the program as an EXE and loads it appropriately. (The 2.3x versions
- fix known bugs.)
-
- Version 2.4 splits the program's Help files out to reduce the size of the
- executable. This allows faster execution from CONFIG.SYS when DOS has only one
- disk buffer available. Searchable access to CFG.DOC is also provided. Both
- changes were something I was planning for awhile. CFG has also become shareware
- with this version.
-
- Numerous utilities exist for use from the command line, but few were available
- for use in CONFIG.SYS. I could find only a few specially written drivers for
- pausing CONFIG.SYS. When I added Qualitas BlueMax 6.0 to my system, what was
- once a relatively short boot process became quite a protracted affair.
-
- I wanted to organize things, add color to the device driver installation phase,
- messages (if necessary) and optional pauses. I foresaw my disk becoming overrun
- by numerous small device drivers (more than it already was), so I wrote the
- basic CFG shell handler and then started looking around for useful utilities.
- Most of what is included was written by myself. Other routines were adapted
- from published sources, many of those were enhanced.
-
- When CFG is executed from CONFIG.SYS as a device driver, it does not remain
- resident in memory and may be run multiple times. CFG sets up its own stack
- during execution to avoid overflowing the DOS stack. The program then moves the
- command line from the system buffer to a local buffer for parsing. Switches are
- parsed, the CommandName is scanned and a SubCommandName checked, if appropriate,
- and the appropriate command is executed. The command is responsible for any
- additional command line parsing. Upon completion of the command, the CFG
- command handler regains control and performs the final clean-up processing
- required by DOS for termination.
-
- Since I wanted to access many CFG routines from the DOS command line or from a
- batch file, I rewrote CFG (as of version 2.0) to be dual mode program: both
- device driver and command line utility. Not all commands, however, are
- available in each mode. An error message will be displayed if a command is
- requested when it cannot be run.
-
- For those who are interested, CFG will run the same command subroutine code from
- both CONFIG.SYS and a batch file, only the program entry point changes. Not
- many DOS functions are [officially] available during device driver installation,
- since the program file fragments that will become the operating system are still
- being assembled when the drivers' initialization routines are run. DOS
- (Interrupt 21H) functions that are [officially] available are: 01H-0CH (various
- character and string input and output routines), 25H (Set Interrupt Vector), 30H
- (Get MS-DOS Version Number), and 35H (Get Interrupt Vector). All BIOS video and
- keyboard routines are available. Within these limits, some very useful things
- can be done. If you bend these limits, even more interesting things are
- possible.
-
- General parsing routines allow any of the standard DOS separator characters to
- be ignored. With the exception of the bright Cls colors noted in the command
- description and a few other clearly identified cases, the number of spaces
- between command line words does not matter.
-
-
- Appendix E: Error Messages
-
-
- [Return]
-
- ANSI not installed
- * Issued if CFG determines that an ANSI screen driver has not been loaded
- into memory when required for a command.
-
- Buffer shifted
- * Issued if the DOS keyboard buffer has been moved from its default location
- when KeyBuffer attempts to change its size.
-
- Cannot display Help in graphics mode
- * Issued if the video system is displaying graphics when Help is requested.
-
- Cannot find file
- * Issued if the requested file cannot be located by the DOS file system.
-
- Cannot locate hidden ports
- * Issued if the signature is missing from the upper memory hidden storage
- location. This could be due to the area having been over-written or due
- to a Restore being run without a preliminary Hide operation for the
- ComHide and LptHide commands.
-
- Cannot run CFG in upper memory
- * Issued if CFG detects that it is being run above the 640KB memory line.
- See the On section for details.
-
- Cannot swap the same port
- * Issued if the ports requested are the same for ComSwap and LptSwap
- commands.
-
- Command not available
- * Issued if the command is not available in the current program mode. Check
- the command's section of this file to see which commands are available
- from CONFIG.SYS and which are available from batch files.
-
- Divide by zero
- * Issued if a Div command divisor is zero.
-
- DOS walk MCB method failed
- * Issued if CFG's internal search routine cannot find the DOS master
- environment based on its validation criteria.
-
- DOS error
- * Issued if DOS returns an error when attempting to perform a requested
- function. The exit ErrorLevel is usually the DOS error number.
-
- Environment error
- * Issued if CFG's environment scanning routine encounters an error in
- processing the environment (scan past end). The DOS is not changed if
- this error occurs.
-
- File error
- * Issued if DOS returns an error when attempting to perform file operations.
- The ErrorLevel is usually the DOS error number.
-
- File exists
- * Issued if the ZeroFile command finds that the requested file already exists
- without the /T option specified.
-
- Hidden ports already present
- * For ComHide or LptHide commands. Issued if Hide is run twice in succession
- without a Restore in between. A second Hide action is prevented since it
- would permanently erase the base port addresses.
-
- IACA already in use
- * Issued if the first character of the IACA is not an ASCII 0 when IACAfill
- is run without the /O Overwrite switch. This indicates other information
- may have already been placed in the IACA.
-
- IACA is empty
- * Issued if the first character of the IACA is an ASCII 0 when IACAread is
- run. This indicates that nothing has been written to the IACA or it has
- been cleared.
-
- Internal Error
- * Issued if one of several error checking routines reports that internal CFG
- has encountered invalid data. This means that the exact situation you
- used a CFG command in has led to the program error. Please send me the
- snippet of the batch file that caused this and the numbers reported after
- the error message. I will work out a fix.
-
- Invalid checksum, ports not restored
- * For ComHide or LptHide commands. The checksum stored with the hidden ports
- shows that the data has been changed since it was written, probably due to
- being over-written.
-
- Invalid color
- * Issued if anything appears after the CommandName that cannot be parsed as a
- screen color when one is required.
-
- Invalid CommandName
- * Issued if the specified CommandName is incorrectly spelled or missing.
- CommandNames cannot be abbreviated.
-
- Invalid DOS version
- * Issued if the command requires a specific minimum DOS version that does not
- match the version currently running.
-
- Invalid drive designation
- * Issued if a valid drive character is not specified on the command line.
-
- Invalid format
- * Issued if the command line format does not match that required by the
- command. Check the command's section of this file for the exact format.
-
- Invalid number
- * Issued if the command line input is not in the correct decimal or
- hexadecimal format.
-
- Invalid number base
- * Issued if the /Bn switch processing encountered an invalid decimal number
- for the new number system base value. See the Base portion of the Global
- section for the valid values.
-
- Invalid SubCommandName
- * Issued if a command's SubCommandName is not correct. CFG checks for a
- match between the first word after the CommandName and values in an
- internal table of valid SubCommandNames for Commands that have
- SubCommands. If a match is not found, this error is issued and no program
- output is made. Check the command's section of this file for the exact
- format.
-
- Invalid video mode
- * Issued if the you try to switch video font size while in graphics mode.
-
- Last PrtScr error
- * Issued if the last DOS print screen command encountered an error. The
- current PrtScr command execution may not occur.
-
- Missing or incorrect command option
- * Issued if the requested Command does not have a required option specified.
- Check the command's section of this file for the exact format.
-
- Missing or invalid port
- * Issued if only one port is given on the command line or if the port
- requested is other than 1/2/3/4 for ComSwap or 1/2/3 for LptSwap.
-
- No batch file running
- * Issued if the Batch command is run from the command line.
-
- Out of environment space
- * Issued if the desired output will cause the environment to exceed its
- maximum size. The output is not made and the environment is not
- corrupted. Delete unneeded environment strings or reboot with a larger
- /E: option specified in CONFIG.SYS on the SHELL line. See the Sample
- section for an example SHELL line.
-
- Overflow
- * Issued if a Mul or Add command total exceeds CFG's 32-bit limit.
-
- Unable to run in upper memory
- * Issued if you try to execute CFG outside of standard DOS low memory.
-
- Underflow
- * Issued if a Sub command operation creates a negative number. At this time,
- CFG cannot handle negative numbers.
-
- Unknown SFT format
- * Issued if the Files command finds an unexpected System File Table format
- when performing its verifications.
-
-
- Appendix F: Sample CONFIG.SYS File
-
-
- [Return]
- The following is a past copy of one my CONFIG.SYS files showing usage of several
- of the commands as well as the MultiCommand format. Line wrap is indicated by
- indentation. This file is from an IBM PS/2 Model 80 with Stacker Version 2.1.
- [Return]
-
- Break = On
- Buffers = 10
- Dos = High
- FCBS = 1
- Files = 8
- LastDrive = G
- Stacks = 8,128
- Shell = C:\Dos\Command.Com C:\Dos /E:800 /P /F
- Device = C:\Dos\Start\Cfg.Com VGA50;Cls Bright White on Blue
- Device = C:\BlueMax\BlueMax.Sys Pro=C:\BlueMax\BlueMax.Pro
- Device = C:\Dos\Start\Cfg.Com Cursor Hide; KeyPause
- Device = C:\BlueMax\386Load.Sys Terse Size=1184 PrgReg=4 FlexFrame
- Prog=C:\Dos\Start\DASDDrvr.Sys
- Device = C:\Norton\Ncache.Exe /Install /Ini=C:\Norton
- Device = C:\Dos\Start\Cfg.Com KeyPause
- Device = C:\BlueMax\386Load.Sys Terse Size=37056 PrgReg=3
- FlexFrame Prog=C:\Dos\Start\Mouse.Sys Ser 2 S06 NB
- Device = C:\Dos\Start\Cfg.Com KeyPause
- Device = C:\BlueMax\386Load.Sys Terse Size=5280 FlexFrame
- Prog=C:\Dos\Start\Bridge_B.Drv /PS60:1B
- Device = C:\Dos\Start\Cfg.Com LptHide Hide; KeyPause
- Device = C:\BlueMax\386Load.Sys Terse Size=30880 PrgReg=3
- FlexFrame Prog=C:\Dos\Start\RCD.Sys /M0
- Device = C:\Dos\Start\Cfg.Com LptHide Restore; KeyPause;Cls Bright White on Blue
- Device = C:\BlueMax\386Load.Sys Terse Size=6768 PrgReg=2 FlexFrame
- Prog=C:\BlueMax\386Disk.Sys 1024 512 64 /XMS
- Device = C:\Dos\Start\Cfg.Com KeyPause
- Device = C:\BlueMax\386Load.Sys Terse Size=9040 PrgReg=2 FlexFrame
- Prog=C:\Dos\Start\ANSI.Sys
- Device = C:\Dos\Start\Cfg.Com Color Bright White on Blue;KeyPause
- Device = C:\Stacker\Screate.Sys F:
- Device = C:\Dos\Start\Cfg.Com KeyPause
- Device = C:\BlueMax\386Load.Sys Terse Size=4907 PrgReg=3 FlexFrame
- Prog=C:\Stacker\Stacker.Com D:\StacVol.Dsk @ F: /EMS /NB
- Device = C:\Dos\Start\Cfg.Com KeyPause
- Device = C:\Stacker\Sswap.Com D:\StacVol.Dsk
- Device = C:\Dos\Start\Cfg.Com KeyPause
- Device = C:\BlueMax\386Load.Sys Terse Size=62573 PrgReg=3
- FlexFrame Prog=C:\NAV\NAV_.Sys /W
- Device = C:\Dos\Start\Cfg.Com KeyPause; VGA25 /C; Cursor 2 2
-
-
- Index
-
-
- [Return]
- Messages14
- Acknowledgments 6 MultiCommand Mode 13
- Add 19 Notes
- AM30 Case 15
- And 19 DOS Environment 15
- ANSI 20 On Loading High 15
- Color Command 25 Undocumented DOS 17
- ASCII 20 Usage From CONFIG.SYS 14
- Association of Shareware Number Base 13
- Professionals 8 Return ErrorLevel 13
- Sample CONFIG.SYS File 83
- Background Discussion 78 Switch Usage 12
- Basic Operation 4 Syntax 11
- Batch 20 Commands 19
- Beep 21 Compare 26
- Bibliography 70 ComSet 27
- Blink 22 ComSwap 27
- Boot 22 Contents 2
- NoError 22 Convert 28
- Border 22 CoProc 28
- Break 22 Country 28
- CPU 29
- CanCopy 23 Cursor 29, 83
- Case on the Command Line 15 Default 29
- Cecho 23 Hide 29, 83
- Cls 23 Restore 29
- ANSI Not Installed 24
- Colors 23 Day 30
- CodePage 24 DESQview 31
- ColdBoot 24 Device 31
- Verify 25 Exist 31
- WaitFor 25 List 31
- WaitTo 25 Rename 31
- Color 25 Dir 31
- Cols 25 DirExist 32
- ComBaud 25 Disclaimer - Agreement 7
- ComHide 26 Disk Files Included with CFG 5
- Hide 26 Display 32
- Restore 26 Div 19
- Command Line Documentation 5
- Global Switches 11 DOS Environment 15
- DosKey 32FileExt 40
- DOSlocation 33FileLines 41
- High 33 FileName40
- Low 33 Files 42
- RAM 33 Blocks 42
- ROM 33 Free 42
- DOSstartup 33 Margin 42
- DOSversion 34 Orphan 42
- Drive 34 Previous 42
- DriveExist 34 Total 42
- DriveID 34 Used 42
- DriveReady 35 FileSize 42
- DriveSize 36 FileText 42
- DriveSpace 36 FullYear 30
- DriveVolume 36
- DS4 37 GamePort 43
- GetKey 43
- Echo 37 Global Switches 11
- EchoPause 38
- EGA25 38 Help 44
- EGA43 38 Hour 30
- Env 38
- Caps 39 IACAfill 44
- Clear 39 IACAread 45
- Fill 39 Input 46
- Free 39 Installation 10
- Reset 39 Locations 10
- Save 39 Procedure 10
- Set 39 Quick Help 10
- Strings 39 Intense 46
- Total 39 Introduction 4
- Used 39
- Environment Keyboard 46
- General Description 15 KeyBuffer 47
- Error Messages 80 Set 46, 47
- ErrorLevel 39 Status 47
- KeyFlush 47
- FileDir 40 KeyPause 47, 83
- FileDrive 40 KeyPress 47
- FileDTC 40 KeyStuff 48
- FileExist 41
- LastBoot 48 Or19
- LastDrive 48
- Left 49 P554
- Length 49 Model 54
- Locate 49 Off 54
- Lock 49 On54
- Disk 50 Step 54
- Net 50 Page 55
- None 50 Pause 55
- Stack 50 PM30
- System 50 Print 55
- Lower 50 PrintEcho 55
- LptHide 50 Off 56
- Hide 50, 83 On56
- Restore 50, 83 Status 56
- LptSet 51 Toggle 56
- LptSwap 51 Printer 56
- Problems and Solutions 69
- MachineName 51 Protected 56
- Memory 52 PrtScr 57
- Base 52 Off 57
- Expanded 52 On57
- Extended 52 Print 57
- High 52 Status 57
- Main 52 Toggle 57
- UMB 52
- Messages 14 RamDrive 57
- Mid 52 RandomFile 58
- Minute 30 Registration 7, 8
- Mod 19 How To 8
- Mono 53 What You Get 8
- Month 30 Why 7
- Mouse 53 Rem 58
- Mul 19 RenDir 59
- MultiCommand Mode 13 Return ErrorLevel 13
- Revision History 71
- Not 19 Right 59
- Now 53 ROMdate 59
- Number Base 13 ROMmodel 59
- RootDir 60
- On Loading High 15 Free 60
- Total 60 MultiCommand Mode 13
- Used 60 Notes
- Rows 60 Case 15
- DOS Environment 15
- Sample CONFIG.SYS File 83 On Loading High 15
- Second 30 Undocumented DOS 17
- Share 60 Usage From CONFIG.SYS 14
- Shareware, Definition 7 Number Base 13
- Shift-AND 60 Return ErrorLevel 13
- ShiftLock 61 Sample CONFIG.SYS File 83
- Caps 61 Switch Usage 12
- Insert 61
- Num 61 Verify 64
- Scroll 61 Version 64
- Shift-OR 61 CFG 65
- ShiftState 62 DOS 65
- Stacker 62 DPMI 65
- Sub 19 EMS 65
- Switch Usage 12 VCPI 65
- SWREG 8 XMS 65
- Syntax 11 VGA25 65, 83
- System Requirements 4 VGA43 65
- VGA50 65
- TaskSwitch 62 VideoMode 66
- Toggle 63
- Tones 63 WaitFor 66
- Down 63 WaitTo 66
- Typematic 63 WarmBoot 67
- Default 64 Verify 67
- Fast 64 WaitFor 67
- Slow 64 WaitTo 67
- WeekDay 30
- Undocumented DOS 17 Window 67
- Upper 64 Windows 67
- Usage From CONFIG.SYS and the
- Command Line 14 Xor 19
- Usage Notes 14
- Use 11 Year 30
- Command Line Syntax 11
- Global Switches 11 ZeroFile 68
- Messages 14
-
-
-