Information About

4dos




name = 4DOS
  Caption A colored directory listing in 4DOS
  Developer JP Software
  Latest Release Version 750130
  Latest Release Date August 25 , 2004
  Operating System DOS , Windows
  Genre Command Shell
  License Freeware
  Website http://jpsoftcom/



4DOS is a Command Line Interpreter by JP Software, designed to
replace the default command interpreter COMMAND.COM in
DOS and Windows 95 / 98 / Me . Related
products that substitute for Windows NT 's command interpreter ( 4NT )
and IBM's OS/2 command interpreter (4OS2) are also available. 4DOS was
written by Rex Conn and Tom Rawson; it was first released in 1989 .


FEATURES


4DOS features a number of enhancements when compared to
COMMAND.COM:

  • Additional commands

  • Extended functionality of existing commands

  • Extended Batch File processing facilities

  • Improved command line editing, including Filename Completion and Command History

  • Support for command Aliases

  • Enhanced Wildcards and the ability to filter by file sizes, date and time stamps, etcetera

  • Extended syntax for Redirection and piping

  • Context-specific online help

  • Colored directory listings

  • Internal variables and variable functions

  • A more sophisticated swapping mechanism, yielding more free Conventional Memory on most systems

  • An interactive debugger for batch files

  • A mechanism for creating, maintaining and displaying file descriptions

  • Configuration stored in an .INI File

  • Support for the Windows Clipboard




HISTORY AND CURRENT STATUS


Originally distributed as Shareware , the now obsolete 4DOS has been
released as unsupported Freeware . The last update was version
7.50.130, released in August 2004 . During its 15-year history,
4DOS underwent numerous updates; here are a few of the most significant.

Some versions of the Norton Utilities for DOS included modified copies
of 4DOS called NDOS. The last version of NDOS was bundled with Norton
Utilities 8, and corresponded to 4DOS 4.03.


4DOS STARTUP


As a DOS command shell intended to replace the default
COMMAND.COM , 4DOS is typically installed via a
SHELL directive in CONFIG.SYS . However, it
can also be launched by any method used to run Executable
programs: typing its filename at a command line or in the Windows
Start /Run Dialog , double-clicking on a
Windows Shortcut icon, and so on. See the
Allenware guide listed under External Links for one
approach to using 4DOS as a secondary shell, and as an external helper for
COMMAND.COM batch files.

4DOS may be passed various Switches (options) in
its command tail. Most of COMMAND.COM's startup switches are
supported, including /P (primary shell), '''/E:''' (environment
size), and /C and '''/K''' (execute a command.) There are also
several new options, most notably @''filename'' to
specify the location of the .INI File and
//''directive'' to process an .INI directive as if
it were present in the .INI file.

Most of 4DOS's configuration is stored in an .INI file. There are well
over 100 directives available, controlling everything from display colors
and key bindings to technical details of memory allocation. This file is
named 4DOS.INI by default, and is usually in the same
directory as the 4DOS.COM binary. Three sections are
significant: {Link without Title} applies to all instances of 4DOS,
{Link without Title} applies only to the first instance of 4DOS loaded into
memory, and {Link without Title} only to other instances. Sections other than
'''[Primary ''' and '''[Secondary]''' are ignored.

After the .INI file is processed 4DOS looks for a startup Batch File ,
typically named 4START.BTM or 4START.BAT and in
the same location as 4DOS.COM, and runs it if found. This
file corresponds, more or less, to the .bashrc script used by
Bash . (4DOS can also run a 4EXIT.BTM or
4EXIT.BAT batch file when it exits, making it possible to
automatically save the Command History or the directory
history to a file on exit and reload it on the next run.) If 4DOS is the
primary shell (i.e. started with the /P switch),
AUTOEXEC.BAT will be run after any
4START. The names and locations of all these
automatically-run batch files may be redefined via .INI directives.


INTERNAL COMMANDS


These are the internal commands provided by 4DOS 7.50, with a brief
description of what each is used for. Commands are not case-sensitive.


File management and directory navigation


; ''d:'' : (a letter followed by a colon) Change the current drive
; ''dirname\'' : (directory name ending with a backslash) Make the specified directory current; implied CDD
; ATTRIB : Display or change file and directory attributes
; CD or CHDIR : Display or change the current Working Directory
; CDD : Change current drive and directory
; COPY : Copy files and directories
; DEL or ERASE : Delete files
; DESCRIBE : Change file descriptions
; DIR : List files and subdirectories
; DIRHISTORY : Display or change the directory history
; DIRS : Display the directory Stack
; EXCEPT : Temporarily hide files from another command
; FFIND : Find files
; FREE : Display free space on drives
; GLOBAL : Recursively visit subdirectories for the benefit of an external command
; HEAD : Display the specified number of lines from the start of a text file
; LIST : Display a text file
; MD or MKDIR : Create subdirectories
; MOVE : Move files from one location to another
; POPD : Restore a saved drive and directory from the directory stack
; PUSHD : Save the current drive and directory on a stack; optionally change directories
; RD or RMDIR : Remove subdirectories
; REN or RENAME : Rename files or subdirectories
; SELECT : Interactively select files for another command
; TAIL : Display the specified number of lines from the end of a text file
; TOUCH : Change date and time stamps of files
; TREE : Display a subdirectory hierarchy
; TRUENAME : Display a canonicalized filename, resolving JOIN and SUBST, network drive mappings, etc.
; TYPE : Dump text files to standard output
; VOL : Display volume labels


Input, output, and user interaction


; BEEP : Make a sound
; CLS : Clear the screen
; COLOR : Change the display colors
; DELAY : Pause for a specified time
; DRAWBOX : Draw a rectangle
; DRAWHLINE : Draw a horizontal line
; DRAWVLINE : Draw a vertical line
; ECHO : Output text to Standard Output ; display or change command echoing
; ECHOERR : Output text to Standard Error
; ECHOS : Output text to Standard Output without appending an End-of-line
; ECHOSERR : Output text to Standard Error without appending an End-of-line
; HEAD : Display the specified number of lines from the start of a text file
; INKEY : Accept a keystroke from the user
; INPUT : Accept a string from the user
; LIST : Display a text file
; PAUSE : Wait for a keystroke from the user
; SCREEN : Position the screen cursor, and optionally display a message
; SCRPUT : Display a message on screen with a specific location and color
; SELECT : Interactively select files for another command
; TAIL : Display the specified number of lines from the end of a text file
; TEE : Split Standard Input to Standard Output and a file
; TEXT : Display a block of lines in a batch file
; TYPE : Dump text files to standard output
; Y : Combine Standard Input and files to Standard Output


Conditional and flow-control commands


; '':label'' : Define a target for GOTO and GOSUB
; ? : List internal commands, or prompt before executing a command
; CALL : Start another batch file like a subroutine; resume after the CALL when it exits
; CANCEL : Abort all batch file processing
; DO : Multiline loop structure for batch files
; EXIT : Terminate the current shell, unless it is the primary shell
; FOR : Single-line loop structure
; GOSUB : Execute a labelled subroutine within a batch file
; GOTO : Jump to a label within a batch file
; IF : Execute a command conditionally
; IFF : Execute a block of commands conditionally
; ON : Enable or disable error handling in a batch file
; QUIT : End processing of the current batch file
; REM : Disregard the remainder of the line as a remark or Comment
; RETURN : End a subroutine, and continue with the command after GOSUB
; SWITCH : Execute a block of lines according to the value of an expression


Other commands


; ? : List internal commands, or prompt before executing a command
; ALIAS : Define or list aliases
; BREAK : Show or change DOS Control-C and Control-Break checking status
; CHCP : Display or change the current DOS code page
; CTTY : Change the DOS console device
; DATE : Display or change the system date
; ESET : Edit the contents of an Environment Variable
; FUNCTION : Create or list user-defined functions
; HISTORY : Display or change the command history
; HELP : Launch the online help system
; KEYBD : Display or change the keyboard toggles
; KEYSTACK : Stack keystrokes for use by another program
; LFNFOR : Enable or disable return of long filenames in FOR
; LH or LOADHIGH : Load a program into Upper Memory
; LOADBTM : Control caching of batch files to memory
; LOCK and UNLOCK : Enable and disable low-level drive access in Windows 95 / 98 / Me
; LOG : Control logging of commands to a text file
; MEMORY : Display usage of DOS memory
; OPTION : Interactively configure 4DOS
; PATH : Display or change the search path
; PROMPT : Change the command prompt
; REBOOT : Restart the computer
; SET : Display or change environment variables
; SETDOS : Change various configuration settings
; SETLOCAL and ENDLOCAL : Save and restore the environment, aliases, current directory, and other settings
; SHIFT : Step through batch file parameters
; START : (OS/2 only) Execute a command in another session
; SWAPPING : Display or change 4DOS disk/memory swapping setup
; TIME : Display or change the system time
; TIMER : Control or display 4DOS internal timers
; UNALIAS : Undefine command aliases
; UNFUNCTION : Undefine user functions
; UNSET : Undefine environment variables
; VER : Display version strings for 4DOS and DOS
; VERIFY : Display or change the DOS write-verify flag
; VSCRPUT : Display text vertically
; WHICH : Display location of a command


VARIABLES



Environment variables


A copy of the environment is inherited by all programs started from 4DOS,
including new instances of 4DOS. In a batch file, the environment may be
saved and restored using the SETLOCAL and ENDLOCAL commands.

Environment variable names should preferentially be composed only of
alphanumerics, underscores, and dollar signs, and should not begin with a
digit. Other names are possible using the bracket syntax, below.

Environment variables are referenced by enclosing the variable name in
percent signs: echo %colordir% The closing percent sign may
be omitted if this does not create an ambiguity for the parser. Strange
variable names containing troublesome characters or nested variables may be
referenced by putting the variable name in brackets with no closing percent
sign:


set 4dos dir=c:\bindos\
set index=2
set var_2=Data
echo 4DOS DIR is % dir
echo VAR_%index is % {Link without Title}


The following environment variables have special significance to 4DOS:

; _CDPATH , CDPATH : Used for directory searches (checked in this order)
; CMDLINE : Contains the current command line
; COLORDIR : Used for directory colorization (overrides .INI directive)
; COMSPEC : Complete pathname of the current shell
; DOSHELP : Pathname of external DOS help utility
; FILECOMPLETION : Used for filename completion
; LOGINNAME : User name
; PATH : Search path
; PATHEXT : Extension search order
; PROMPT : Used to display the interactive prompt
; TEMP4DOS, TEMP, TMP : Used for temporary and pipe files (checked in this order)
; TITLEPROMPT : Used to customize the title bar in Windows 95/98/Me


Internal variables


4DOS implements over 60 internal variables, which are referenced like
environment variables (with a leading percent sign) but are not stored in
the environment block. Like environment variables, internal variables are
evaluated before the command is executed, so they may be used with external
commands as well as internal commands. The following list is not complete.

; %? : Return code of the last external program
; %_? : Return code of the last internal command
; %+ : Current command separator character
; %= : Current syntactic escape character
; %_4VER : 4DOS version
; %_ALIAS : Free alias space (bytes)
; %_ANSI : ANSI driver detected?
; %_BATCHLINE : Line number in the current batch file
; %_BATCHNAME : Complete filename of the current batch file
; %_BG : Background color under the cursor
; %_BOOT : Drive from which DOS was booted
; %_COLUMN : Current cursor horizontal position
; %_CPU : Processor type
; %_CWD : Current drive and directory
; %_CWP : Current directory
; %_DATE : Current date, in the local date format
; %_DISK : Current drive letter
; %_DOSVER : Returns the DOS version
; %_ENV : Free environment space (bytes)
; %_FG : Foreground color at the cursor
; %_ISODATE : Current date in ISO format
; %_LASTDISK : DOS LASTDRIVE value
; %_MOUSE : Mouse driver detected?
; %_ROW : Current cursor vertical position
; %_SHELL : Shell nesting level
; %_TIME : Current time, in the local time format
; %_WIN : Microsoft Windows detected?


Variable functions


Variable functions are referenced much like internal or environment
variables, with a leading percent sign. Unlike variables, however, they
take one or more arguments, somewhat like functions in a
Programming Language . Variable function arguments are enclosed in
square brackets. Variable functions are expanded before the command is
executed, so they can be used with both internal and external
commands. 4DOS supports over 100 variable functions; the following list is
not complete.

; %@ASCII {Link without Title} : Returns values of characters
; %@ATTRIB {Link without Title} : Return a file's attributes
; %@CDROM {Link without Title} : Is drive ''d:'' a CD-ROM?
; %@CHAR {Link without Title} : ASCII character with value ''n''
; %@CRC32 {Link without Title} : Computes CRC32 checksum
; %@DATE {Link without Title} : Converts a calendar date to a DOS day number, January 1 , 1980 being 0.
; %@DEC {Link without Title} : Returns ''n'' minus 1