
















                         4DOS  *  4OS2  * 4NT




                           Reference Manual




                             Developed By
                        Rex Conn and Tom Rawson

                           Documentation By
               Hardin Brothers, Tom Rawson, and Rex Conn


                             Published By

                           JP Software Inc.
                             P.O. Box 1470
                       East Arlington, MA 02174
                                U.S.A.

                            (781) 646-3975
                          fax (781) 646-0904






                            ACKNOWLEDGMENTS


       We couldn't produce products like 4DOS, 4OS2, and 4NT without
       the dedication and quality work of many people.  Our thanks
       to:

            JP Software Staff:  Christine Alves, Mike Bessy, Janet
            Casey, Ed Lucas, Ellen Stone.

            Online Support:  The staff at CompuServe's PC-NET,
            Software Tool and Die (Brookline, MA) and TIAC (The
            Internet Access Co., Bedford, MA); Brian Miller and Tess
            Heder of Channel 1 BBS, Cambridge, MA.

            Beta Test Support:  The sysops of CompuServe's CONSULT
            forum.

            Beta Testers:  We can't list all of our beta testers
            here!  A special thanks to all of you who helped make
            4DOS, 4OS2, and 4NT elegant, reliable, and friendly.

       The following tools are used in creating and maintaining our
       products:

            Compilers:       Watcom C, Microsoft C, Microsoft Macro
                             Assembler, Borland Turbo Pascal

            Libraries:       Spontaneous Assembly (Base Two), Turbo
                             Professional (Turbo Power Software),
                             C/Windows Toolchest (Mix Software)

            Editors:         Edix (Emerging Technology), Boxer
                             (Boxer Software)

            Debuggers:       Watcom Debugger (Watcom), Soft-ICE and
                             Bounds Checker (Nu-Mega Technologies)

            Version Control: PVCS (Intersolv)

            Documentation:   Microsoft Word for Windows

       Copyright 1998, JP Software Inc., All Rights Reserved.  4DOS,
       4OS2, and 4NT are JP Software Inc.'s trademarks for its
       family of character-mode command processors.  Take Command is
       a registered trademark and JP Software, jpsoft.com, and all
       JP Software designs and logos are trademarks of JP Software
       Inc.  Other product and company names are trademarks of their
       respective owners.  (1-98)
  -i-


  CONTENTS

  Introduction ......................................................1
      How to Use This Manual ........................................2
      Registration and Upgrade Information ..........................5
      Technical Support .............................................5

  Chapter 1 / General Concepts ......................................6
      Operating Systems and Command Processors ......................6
          Primary and Secondary Shells ..............................8
      Files and Directories .........................................9
          Drives and Volumes ........................................9
          File Systems .............................................10
          Network File Systems .....................................12
          Directories and Subdirectories ...........................12
          File Names ...............................................14
          File Attributes and Time Stamps ..........................15
      OS/2 Extended Attributes .....................................16
      Internal and External Commands ...............................17
      Executable Files and File Searches ...........................18
      The Environment ..............................................21
      Character Sets, ASCII, and Key Codes .........................22
      The Keyboard .................................................23
      Video ........................................................24
      ANSI Drivers .................................................25

  Chapter 2 / Conventions ..........................................27
      Colors and Color Names .......................................27
          Blinking Text and Bright Background Colors ...............28
      Keys and Key Names ...........................................30
      Popup Windows ................................................32

  Chapter 3 / Using 4DOS, 4OS2, and 4NT ............................34
      4DOS, 4OS2, and 4NT for Take Command Users ...................34
      At the Command Line ..........................................34
          Command-Line Editing .....................................35
          Command History and Recall ...............................36
          Command History Window ...................................39
          Local and Global Command History .........................40
          Filename Completion ......................................41
          Filename Completion Window ...............................44
          Automatic Directory Changes ..............................45
          Directory History Window .................................46
          Multiple Commands ........................................48
          Expanding and Disabling Aliases ..........................48
          Command Line Help ........................................49
          Command-Line Length Limits ...............................50
      Page and File Prompts ........................................50
      Directory Navigation .........................................51
          Extended Directory Searches ..............................53
          CDPATH ...................................................56
      Input and Output .............................................57
          Redirection ..............................................58
          Piping ...................................................61
          Keystack .................................................62
      File Selection ...............................................64
  -ii-

          Extended Parent Directory Names ..........................64
          Wildcards ................................................64
          Date, Time, and Size Ranges ..............................67
          File Exclusion Ranges ....................................72
          Multiple Filenames .......................................72
          Include Lists ............................................73
          LFN File Searches ........................................74
          Executable Extensions ....................................75
          Using Windows File Associations ..........................77
          Using Internet URLs ......................................78
      Critical Errors ..............................................79
      Advanced Features ............................................80
          Conditional Commands .....................................80
          Command Grouping .........................................81
          Escape Character .........................................83

  Chapter 4 / Aliases and Batch Files ..............................85
      Aliases ......................................................85
      Batch Files ..................................................88
          .BAT, .CMD, and .BTM Files ...............................88
          Echoing ..................................................89
          Batch File Parameters ....................................89
          Using Environment Variables ..............................90
          Batch File Commands ......................................91
          Interrupting a Batch File ................................93
          Automatic Batch Files ....................................93
          Detecting 4DOS, 4OS2, or 4NT .............................95
          Using Aliases in Batch Files .............................95
          Debugging Batch Files ....................................97
          String Processing .......................................100
          Line Continuation .......................................103
          Batch File Compression ..................................103
          REXX Support ............................................104
          EXTPROC Support .........................................106
      Using the Environment .......................................107
          Configuration Variables .................................109
          Internal Variables ......................................110
          Variable Functions ......................................119
      Special Character Compatibility .............................136
      Command Parsing .............................................138
          Argument Quoting ........................................140

  Chapter 5 / Configuration .......................................142
      Modifying the .INI File .....................................142
      Using the .INI File .........................................143
      .INI File Sections ..........................................144
      .INI File Directives ........................................144
          Types of Directives .....................................146
          Initialization Directives ...............................148
          Configuration Directives ................................153
          Color Directives ........................................159
          Key Mapping Directives ..................................161
          Advanced Directives .....................................166
          Examples ................................................168

  Chapter 6 / Command Reference Guide .............................170
      Command Categories ..........................................170
  -iii-

      How to Use the Command Descriptions .........................172
      ? ...........................................................176
      ACTIVATE ....................................................177
      ALIAS .......................................................178
      ASSOC .......................................................188
      ATTRIB ......................................................189
      BEEP ........................................................192
      BREAK .......................................................194
      CALL ........................................................195
      CANCEL ......................................................196
      CD / CHDIR ..................................................197
      CDD .........................................................199
      CHCP ........................................................201
      CLS .........................................................202
      COLOR .......................................................203
      COPY ........................................................204
      CTTY ........................................................212
      DATE ........................................................213
      DEL / ERASE .................................................214
      DELAY .......................................................218
      DESCRIBE ....................................................219
      DETACH ......................................................222
      DIR .........................................................223
      DIRHISTORY ..................................................238
      DIRS ........................................................240
      DO ..........................................................241
      DPATH .......................................................244
      DRAWBOX .....................................................245
      DRAWHLINE ...................................................247
      DRAWVLINE ...................................................248
      ECHO and ECHOERR ............................................249
      ECHOS and ECHOSERR ..........................................251
      ENDLOCAL ....................................................252
      ESET ........................................................253
      EXCEPT ......................................................255
      EXIT ........................................................257
      FFIND .......................................................258
      FOR .........................................................263
      FREE ........................................................272
      FTYPE .......................................................273
      GLOBAL ......................................................275
      GOSUB .......................................................277
      GOTO ........................................................279
      HELP ........................................................281
      HISTORY .....................................................282
      IF ..........................................................284
      IFF .........................................................291
      INKEY .......................................................293
      INPUT .......................................................296
      KEYBD .......................................................298
      KEYS ........................................................299
      KEYSTACK ....................................................300
      LH / LOADHIGH ...............................................305
      LIST ........................................................308
      LOADBTM .....................................................313
      LOCK ........................................................314
      LOG .........................................................215
  -iv-

      MD / MKDIR ..................................................317
      MEMORY ......................................................319
      MOVE ........................................................321
      MSGBOX ......................................................326
      ON ..........................................................327
      OPTION ......................................................329
      PATH ........................................................331
      PAUSE .......................................................333
      POPD ........................................................334
      PROMPT ......................................................335
      PUSHD .......................................................339
      QUIT ........................................................341
      RD / RMDIR ..................................................342
      REBOOT ......................................................343
      REM .........................................................345
      REN / RENAME ................................................346
      RETURN ......................................................349
      SCREEN ......................................................350
      SCRPUT ......................................................351
      SELECT ......................................................353
      SET .........................................................360
      SETDOS ......................................................363
      SETLOCAL ....................................................370
      SHIFT .......................................................371
      SHRALIAS ....................................................372
      START .......................................................374
      SWAPPING ....................................................381
      SWITCH ......................................................382
      TEE .........................................................385
      TEXT ........................................................386
      TIME ........................................................387
      TIMER .......................................................388
      TITLE .......................................................390
      TOUCH .......................................................391
      TREE ........................................................393
      TRUENAME ....................................................395
      TYPE ........................................................396
      UNALIAS .....................................................397
      UNLOCK ......................................................398
      UNSET .......................................................399
      VER .........................................................401
      VERIFY ......................................................402
      VOL .........................................................403
      VSCRPUT .....................................................404
      WINDOW ......................................................406
      Y ...........................................................407

  Appendix A / Error Messages .....................................408

  Index ...........................................................419
  -1-


  INTRODUCTION


       We have designed this manual to accompany three of our
       products: 4DOS, 4OS2, and 4NT.  This ASCII text version has
       been formatted differently than our printed manuals in order
       to be more easily used with braille or screen-reading software
       and hardware.

       Each of these programs is a command interpreter or "shell."
       That means that they respond to the commands you type at the
       C:\> or [C:\] prompt.  Each is designed to replace the
       default command interpreter that was supplied with your
       operating system:

            4DOS      replaces  COMMAND.COM from DOS or Windows 95
            4OS2      replaces  CMD.EXE from OS/2
            4NT       replaces  CMD.EXE from Windows NT

       4DOS can also be used as the command interpreter for DOS
       sessions running under OS/2, and under Windows 3.0 and above.

       Each of our products is highly compatible with the command
       interpreter that it replaces.  That means that you don't have
       to change your computing habits or unlearn anything to use
       any of these products.  Each also adds many new features and
       commands to its operating environment.  They make the
       operating system friendlier, easier to use, and much more
       powerful and versatile, without requiring you to learn a new
       program, a new set of commands, or a new style of work.

       Each product is shipped with this manual plus a smaller
       Introduction and Installation Guide.  Please start with the
       smaller manual.  It will tell you how to get started with the
       product you purchased and also contains some other
       information that applies specifically to that product.  The
       Introduction and Installation Guide also contains details on
       how to contact JP Software for technical support, customer
       service, or other assistance.

       Once you have installed 4DOS, 4OS2, or 4NT, you can learn its
       features at your own pace.  Relax, enjoy the power of your
       new program, and browse through both manuals occasionally.
       Press the F1 key whenever you need help.  The program will
       soon become an essential part of your computer, and you'll
       wonder how you ever got along without it.

       We are constantly working to improve these programs.  If you
       have suggestions for features or commands that you think we
       should include in the next version, or any other way we could
       improve our product, please let us know.  Many of the
       improvements in this version were suggested by our users, and
       while we can't promise to include every suggested feature, we
       really do appreciate and pay attention to your comments.
  -2-



  How to Use This Manual

       This manual covers three separate products:  4DOS, 4OS2, and
       4NT.  We have combined reference information for the products
       in one manual because 4DOS, 4OS2, and 4NT offer almost
       exactly the same features and commands, so individual manuals
       would be almost identical.  In addition, printing a single
       manual assists those customers who use more than one product,
       reduces our costs and lets us bring you the most powerful
       command interpreters available for the lowest possible price.

       Most of this manual describes commands and features which are
       available in all three products.  When we need to discuss the
       features or behavior of a single product, we mention it
       specifically in the text.  When an entire paragraph or
       section applies to a specific product, we use marginal text
       to identify that product:

4DOS   marks sections that apply only to 4DOS.

4OS2   marks sections that apply only to 4OS2.

4NT    marks sections that apply only to 4NT.

       Occasionally, a feature will be marked with two of these
       marginal notations when it applies to two different products.

       We have designed this manual to serve as an introduction to
       our products for novice users and as a reference manual for
       advanced users.

       You will likely find some parts of the manual too simple or
       too technical for your tastes.  Unless you are convinced that
       one of those sections holds just the information you need for
       a specific task, feel free to skip to the next part of the
       manual that is more to your liking.  You can use almost every
       feature of our products without having to worry about other
       features or commands.

!      As you read the manual, you will occasionally see an
       exclamation point [!] next to a paragraph.  The exclamation
       point means that that paragraph contains a caution or warning
       you should observe when using the feature it discusses.

##     You will also see the symbol ## next to certain paragraphs.
       This indicates the first of one or more paragraphs containing
       an in-depth discussion or a more advanced topic, which you
       can skip if you wish to stick with the basics.  Come back to
       this topic later for more details, or if you're having
       trouble with the particular issue it discusses.  If you see
       the ## next to a section heading, it means the entire section
       contains such information.

       You may find the information in such marked sections useful
       even if you're relatively new to computers or to our
  -3-

       products.  However, you can also skip the marked section and
       still understand and use the basic features described in the
       topic you're reading.

       This manual is divided into six chapters and two appendices,
       plus an index.  Here's a brief overview of what you'll find
       in each:


       Chapter 1 / General Concepts

            This chapter is an introduction to several terms and
            concepts that we use throughout the manual.  If you're a
            novice, you might want to browse through the entire
            chapter.  If you're a power user and all of the topics
            in this chapter seem simple, then go on to the next
            chapter.  If you think you need to brush up a bit on the
            basics of a couple of terms and ideas, you'll probably
            find them here.


       Chapter 2 / Conventions

            This chapter contains information about three
            conventions that are used throughout 4DOS, 4OS2, and
            4NT:  colors and color names, keys and key names, and
            popup windows.  You'll find many references in the
            manual to the information in this chapter.  You may
            choose to read through this chapter to see what is
            available, or refer to the topics here when you come to
            a cross reference later in the manual.


       Chapter 3 / Using 4DOS, 4OS2, and 4NT

            This chapter is for everyone.  It contains a description
            of 4DOS, 4OS2, and 4NT features, and lots of examples to
            help you learn to use each one.  Even if you are a
            novice user and want to ignore some of these features
            until later, skim through this chapter to get an idea of
            what is available and where to find the information that
            you will eventually want.  Our products offer both
            features which are not related to specific commands, and
            a complete set of over 90 internal commands.  This
            chapter has reference information on most of the non-
            command features.  Reference information on commands is
            in Chapter 6.


       Chapter 4 / Aliases and Batch Files

            This chapter introduces two of the most powerful
            features in 4DOS, 4OS2, and 4NT:  Aliases and Batch
            Files.  You can use both to automate much of your
            computing work.  Even if you are a novice user, you
            should skim through this chapter to see what is
            available.  This chapter also contains information about
  -4-

            using environment variables, and the internal variables
            and variable functions that make aliases and batch files
            extremely powerful and flexible.


       Chapter 5 / Configuration

            This chapter is for anyone who wants to personalize
            4DOS, 4OS2, or 4NT, and for advanced users who want to
            be sure that the command processor is running at top
            efficiency on their systems.  It includes detailed
            information on setting up your command processor and on
            changing its configuration.


       Chapter 6 / Command Reference Guide

            Each of our products offers over 90 internal commands.
            This chapter explains the purpose of each command and
            tells you how to use it.  It has examples that will help
            you learn each command, and the technical details you
            will need to get the command to behave exactly as you
            wish.


       Appendix

            Appendix A lists all error messages.  Look here if you
            need an explanation of an error message, or if you
            aren't sure if the message came from 4DOS, 4OS2, or 4NT.


       Index

            If you can't find the information you need, this should
            help you find it.


       Additional Information

            Files distributed with each of our products cover
            important additional information beyond what's included
            in this manual.

            4DOS, 4OS2, and 4NT include complete online help for all
            commands and other features.  The online help provides
            much of the same information that is available in this
            manual and the Introduction and Installation Guide, but
            in an electronic form which you can access quickly.  The
            online help also includes details about changes in the
            latest version of our products, compatibility with other
            products, and additional technical and reference
            information.  See your Introduction and Installation
            Guide for more information about the online help.

            When you receive your copy of 4DOS, 4OS2, or 4NT be sure
            to look through README.TXT, which contains general
  -5-

            notes, highlights of the latest release, and brief
            installation instructions for those upgrading from a
            downloaded copy.  Important additional information may
            be included in other files distributed with your
            product; if so, README.TXT will refer you to those files
            as well.


  Registration and Upgrade Information

       If you purchased 4DOS, 4OS2, or 4NT from a software dealer,
       your copy came with a registration card (packed in the
       diskette envelope, or with the literature accompanying your
       product).  Please fill out this card and return it promptly
       to JP Software.  It ensures that we have a record of your
       registration so that we can give you ongoing technical
       support and notices of upgrades.  If you purchased 4DOS,
       4OS2, or 4NT directly from JP Software, you are already
       registered and no registration card is necessary.

       4DOS, 4OS2, and 4NT are upgraded regularly through
       maintenance releases, designed to fix minor problems or
       improve compatibility, and major upgrades which contain
       enhancements and additional features.  For complete details
       about obtaining upgrades and new releases, see your
       Introduction and Installation Guide.


  Technical Support

       Technical support is available via public electronic support
       conferences, private electronic mail, telephone, fax, and
       mail.  For complete details see the section on Technical
       Support in your Introduction and Installation Guide or the
       Troubleshooting, Service and Support topic in the online
       help.
