home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 3
/
CDASC03.ISO
/
sorties
/
1959
/
4os2.doc
< prev
next >
Wrap
Text File
|
1993-04-01
|
170KB
|
3,581 lines
44
44
44 OOOOO SSSSSS 222222
44 OOOOOOO SSSSSSSS 22222222
44 44 OO OO SS 22 22
44 44 OO OO SS 22
44 44 OO OO SSSSSS 222
444444444 OO OO SSSSSS 222
44444444 OO OO SS 222
44 OO OO SS 222
44 OOOOOOO SSSSSSSS 222222222
44 OOOOO SSSSSS 222222222
Version 1.00
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
USA
(617) 646-3975
fax (617) 646-0904
Program and Documentation Copyright 1988, 1989, 1990, 1991,
1992, Rex C. Conn and JP Software Inc., All Rights Reserved.
4OS2 is a trademark and 4DOS (R) is a registered trademark of
JP Software Inc. OS/2 (R) is a registered trademark of IBM
Corporation. Other product and company names are trademarks
of their respective owners.
ACKNOWLEDGMENTS
We couldn't produce a product like 4OS2 without the dedication
and quality work of many people. Our thanks to:
JP Software Staff: Mike Bessy, Kevin Cocilo, Helen
Coyne, Hayyim Feldman, Henry Harvey, Ellen Stone, Misty
White.
Beta Test Support: David Moskowitz, Guy Scharf, Larry
Finkelstein, and Martin Schiff, of CompuServe's CONSULT
forum.
Online Support: Brian Miller and Tess Heder of Channel 1
BBS; Don Watkins of CompuServe's IBMNET.
Beta Testers: We can't list all of our beta testers
here. A special thanks to all of you who helped make
4OS2 elegant, reliable, and friendly!
Help Text Conversion: Matthew J. Palcic.
SHRALIAS Program: Bill Hinkle.
The following tools are used in creating and maintaining 4OS2 and
the 4OS2 Help:
Compilers: Microsoft C 6.0 and Macro Assembler 5.1
and 6.0
Libraries: Spontaneous Assembly (Base Two
Development)
Editors: Edix (Emerging Technology), Brief
(Borland), QEdit (SemWare)
Version Control: PVCS (Intersolv)
Help Compiler: IBM Information Presentation Facility
Documentation: Microsoft Word for Windows with Adobe
Type Manager
CONTENTS
___________________________________________________________________
CONTENTS
Introduction.............................................1
How to Use This Manual..............................2
Chapter 1 / Installation.................................4
Installing 4DOS for OS/2 DOS Sessions...............4
Installing 4OS2.....................................4
Automated 4OS2 Installation.........................5
Manual 4OS2 Installation............................6
Manual Installation for OS/2 Version 1.x.......7
Manual Installation for OS/2 Version 2.0.......7
4OS2 Files and Directories.....................8
Uninstalling 4OS2...................................9
Chapter 2 / General Concepts.............................10
Terminology.........................................10
OS/2 Sessions and Applications......................10
Sessions and Session Types.....................11
Applications and Application Types.............13
Starting Sessions and Applications.............14
Creating and Configuring Icons......................15
OS/2 Version 1.x Icons.........................15
OS/2 Version 2.0 Icons.........................16
Primary and Secondary Shells........................17
High Performance File System (HPFS).................17
Extended Attributes.................................18
Chapter 3 / Using 4OS2...................................20
At the Command Line.................................20
4OS2 HELP......................................20
Shared History and Alias Lists.................21
Special Characters.............................22
Executable File Names...............................23
Redirection.........................................23
Piping..............................................24
4OS2 Internal Variables.............................25
4OS2 Variable Functions.............................26
Batch Files.........................................27
4OS2 Startup and Exit Files.........................28
Using STARTUP.CMD..............................28
Using 4START and 4EXIT.........................29
REXX Support........................................29
EXTPROC Support.....................................30
Chapter 4 / Configuration and Tuning.....................32
Creating and Configuring 4OS2 Icons.................32
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / i
CONTENTS
___________________________________________________________________
4OS2 Command Line Options...........................33
Using 4OS2.INI......................................35
4OS2.INI Directives............................35
Configuring 4OS2 Help...............................36
Using 4DOS with OS/2................................37
Changing the OS/2 CONFIG.SYS File..............38
Using 4DOS with OS/2 Version 1.x...............39
Using 4DOS with OS/2 Version 2.0...............40
4DOS.INI for OS/2 Version 2.0 DOS Sessions.....42
Startup Files for OS/2 Version 2.0 DOS Sessions43
"Temporary" VDMs...............................44
Configuring 4DOS for Dual Boot and Boot Manager44
Chapter 5 / Command Reference Guide......................48
DETACH..............................................49
DIR.................................................50
DPATH...............................................51
HELP................................................52
KEYS................................................53
SETDOS..............................................54
START...............................................55
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / ii
INTRODUCTION
___________________________________________________________________
INTRODUCTION
Welcome, and thanks for purchasing 4OS2!
We developed 4OS2 to bring the power and convenience of our popular
4DOS program to users of the OS/2 operating system. Whether you
are a computer novice or an experienced user, we think that 4OS2
will help you get the most out of your OS/2 system.
4OS2, like its cousin 4DOS, is a command interpreter or "shell."
We have designed 4OS2 to be compatible with both 4DOS and with
OS/2's normal shell program, which is called CMD.EXE.
If you are familiar with 4DOS or with the OS/2 command prompt, you
won't have to change your computing habits or unlearn anything to
use 4OS2. If you know how to use commands to display a directory,
copy a file, or start an application program, you already know how
to use 4OS2. And if you are a 4DOS user, you already know how to
use most of the advanced features that we have built into 4OS2.
You can even use many of your 4DOS batch files with 4OS2 without
changing them at all (see pages 23 and 27 for tips about making the
batch files work properly in both environments).
Once you have 4OS2 installed, you can learn its new features at
your own pace. Relax, enjoy 4OS2's power, and browse through the
manuals occasionally. Press the F1 key whenever you need help.
4OS2 will soon become an essential part of your computer, and
you'll wonder how you ever got along without it.
This version of 4OS2 is designed for and has been tested with OS/2
versions 1.2, 1.21, 1.3, and 2.0. You must have one of these
versions of OS/2 operating on your computer to be able to install
and use 4OS2. Throughout this manual, we refer to versions 1.2,
1.21, and 1.3 as "version 1.x."
We are constantly working to improve 4OS2. If you have suggestions
for features or commands that we should include in the next
version, or any other way we could improve our product, please let
us know. Many of the features in this version of 4OS2 were
suggested by our users and beta testers. We can't promise to
include every suggestion, but we really do appreciate and pay
attention to your comments.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 1
INTRODUCTION
___________________________________________________________________
How to Use This Manual
Because 4OS2 is almost identical to 4DOS in operation, nearly
everything in the 4DOS Reference Manual applies to 4OS2 as
well. Therefore, we supply both this manual and the 4DOS
Reference Manual with every copy of 4OS2. Use the 4DOS
Reference Manual as your main 4OS2 manual; this booklet is a
supplement that explains the added features in 4OS2 and the
occasional differences between the two products.
We publish the manuals in this form because most 4OS2
customers also use 4DOS. This supplement helps focus
attention on the few differences between 4OS2 and 4DOS; two
completely separate manuals would make those differences more
difficult to pinpoint and to remember.
If you aren't already familiar with 4DOS, we urge you to
install it for use in your OS/2 DOS sessions. Because 4DOS
and 4OS2 are so similar, you can install 4DOS first and take
the 4DOS Guided Tour (see Chapter 3 of the 4DOS Reference
Manual) to familiarize yourself with both products.
If you prefer to work in OS/2, or if you don't have 4DOS, you
can install 4OS2 without 4DOS and look through the Guided Tour
and other parts of the 4DOS manual to gain a feel for how 4OS2
works. Then return to this manual, especially Chapter 3, for
a discussion of the differences between 4DOS and 4OS2.
Installation instructions for both products are in the next
chapter, and detailed installation instructions for 4DOS are
in Chapter 1 of the 4DOS manual.
If you are familiar with 4DOS, you may want to read quickly
through this manual to get a general feeling for the few
differences between the two products. Then you can install
4OS2 on your computer and study the differences that affect
your computing habits in detail.
There are five chapters in this manual. Here is what you'll
find in each:
Chapter 1 / Installation
This chapter explains how to install 4OS2. Because the
installation instructions vary depending on the version
of OS/2 that you are using, everyone should read this
short chapter.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 2
INTRODUCTION
___________________________________________________________________
Chapter 2 / General Concepts
OS/2 is a rich operating system with a wide range of
features. We don't have space for a complete OS/2
tutorial, but some of the concepts and terms you need to
configure and make full use of 4OS2 are explained in this
chapter. Even if you are an experienced OS/2 user, we
encourage you to read Chapter 2 before using 4OS2
extensively.
Chapter 3 / Using 4OS2
This chapter explains the differences between 4DOS and
4OS2. It is a supplement to Chapter 5 / Using 4DOS in
the 4DOS Reference Manual.
Chapter 4 / Options and Tuning
This chapter discusses how to configure 4OS2. It also
explains how to configure 4DOS to run most efficiently as
the command processor for DOS sessions under OS/2.
Chapter 5 / Command Reference
The final chapter provides details about the commands
that are new in 4OS2 and about those which differ from
4DOS. It is a supplement to Chapter 8 / Command
Reference Guide in the 4DOS Reference Manual.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 3
CHAPTER 1 / INSTALLATION
___________________________________________________________________
CHAPTER 1 / INSTALLATION
Before you install 4OS2 (or any other software, for that matter),
you should make a bootable system diskette so you can recover in
case of a power failure or other interruption during the
installation process. The easiest way to do so is to create a
bootable DOS system disk (see page 13 of the 4DOS reference
manual). If necessary, you can use your OS/2 installation disks to
boot your system, then exit the installation program at the first
opportunity and return to an OS/2 (CMD.EXE) command prompt.
Installing 4DOS for OS/2 DOS Sessions
4DOS and 4OS2 must be installed separately even if you
obtained them at the same time. The easiest way to install
4DOS is to boot your computer with DOS and follow the
installation instructions in the 4DOS Reference Manual.
If your computer is set up to boot OS/2 only, you can still
install 4DOS easily. Start a DOS session and then install
4DOS from within the DOS session. Put all of your 4DOS files
in a separate directory, not in the 4OS2 directory. Try the
4DOS Guided Tour (Chapter 3 of the 4DOS Reference Manual) to
make sure that 4DOS has been installed properly.
After you have used one of these methods to install 4DOS on
your hard drive, turn to pages 37 - 44 for information about
configuring 4DOS to work properly with OS/2. That section
also explains how to modify your OS/2 CONFIG.SYS file if you
are installing 4DOS manually, or if you installed OS/2 after
4DOS.
Installing 4OS2
See the sections below for specific instructions on installing
4OS2 automatically, manually under OS/2 version 1.x, or
manually under OS/2 version 2.0.
Once you have 4OS2 installed, the standard "OS/2 Window" and
"OS/2 Full Screen" selections in your Group-Main window (OS/2
version 1.x) or Command Prompts folder (OS/2 version 2.0) will
start 4OS2 instead of CMD.EXE (unless they have been changed
from their default configuration). You may wish to change the
names of these selections to "4OS2 Window" and "4OS2 Full
Screen".
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 4
CHAPTER 1 / INSTALLATION
___________________________________________________________________
If you have a STARTUP.CMD batch file, it will run just as it
did before you installed 4OS2. OS/2 will create a 4OS2
session at boot time and pass the STARTUP.CMD command to that
session, just as it did with CMD.EXE.
For information about creating additional 4OS2 icons,
configuring 4OS2, and setting up startup batch files for
specific 4OS2 sessions, see pages 15 and 32.
Automated 4OS2 Installation
If you downloaded 4OS2, see the section on manual installation
below. Automated installation is only available if you have
the version of 4OS2 distributed on a diskette.
When you are ready to install 4OS2, put the distribution
diskette into drive A (you may use drive B if you prefer).
Open an OS/2 windowed or full-screen session, then log into
drive A by typing:
a:
and pressing Enter. One of the files on the distribution
diskette, README.1ST, contains information that you should
read before you install 4OS2 on your computer. Type:
type readme.1st | more
to view the file. If you want to print a copy of the file,
type:
copy readme.1st prn
Now you can start the installation process. Type:
install
Once the installation program has started, just follow the
instructions on the screen and 4OS2 will install itself on
your system. The installation program will ask whether you
want to perform a full installation or a partial installation.
If you want to install 4OS2 automatically, choose a full
installation. The program will not make any changes to your
CONFIG.SYS or other system files unless you give it permission
to do so.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 5
CHAPTER 1 / INSTALLATION
___________________________________________________________________
Once the installation process is complete, shut down OS/2 and
reboot your computer. You will then have all the power of
4OS2 available to you.
Manual 4OS2 Installation
If you downloaded 4OS2, simply extract the downloaded files
into their own directory (do not put them in the same
directory as your 4DOS files). Then skip the next two
paragraphs related to diskette copies of 4OS2, and proceed
with the remainder of the manual installation instructions.
If you have a diskette copy of 4OS2, the 4OS2 files are
contained in a special library file on the diskette. You
cannot simply copy the files from the diskette onto your
system. You must use the installation program to extract and
decompress the 4OS2 files if you want to perform a manual
installation, or if you need to replace a damaged 4OS2 file on
your hard disk.
If you want to install 4OS2 manually, first start the
automatic installation program using the instructions above.
Select the Extract all files option and extract the 4OS2 files
onto your hard disk. Place the files in their own directory.
Do not put them in the same directory as your 4DOS files. In
the examples below, we have assumed that the 4OS2 files are in
the C:\4OS2 directory.
Once you have extracted the files, you can test drive 4OS2
before completing the installation. To do so, start an OS/2
windowed or full-screen session from the Presentation Manager
desktop. At the CMD.EXE prompt, change to the directory where
4OS2 is installed, and enter the command 4OS2. When run in
this mode, 4OS2's HELP command and F1 key, along with the "/?"
option for 4OS2 commands, may not work if the required files
are not accessible. You can activate these features during
your test drive by following the instructions for 4OS2.INF and
4OS2H.MSG in the 4OS2 Files and Directories section below.
When you're ready to finish the installation process, follow
the instructions in the appropriate sections below. Before
you modify CONFIG.SYS, be sure you have a bootable floppy disk
as discussed above.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 6
CHAPTER 1 / INSTALLATION
___________________________________________________________________
Manual Installation for OS/2 Version 1.x
Use an ASCII-format text editor to load and edit your OS/2
CONFIG.SYS file. In the file, you will find a line that
begins with the word PROTSHELL and another that begins with
the words SET COMSPEC. The lines should look something like
this, but they may not be adjacent in the file (the PROTSHELL
command is all on one line):
PROTSHELL=C:\OS2\PMSHELL.EXE C:\OS2\OS2.INI
C:\OS2\OS2SYS.INI C:\OS2\CMD.EXE
SET COMSPEC=C:\OS2\CMD.EXE
Change the last item on the PROTSHELL line, the item that
includes the filename CMD.EXE, to point to 4OS2.EXE. Be sure
to include the full path for 4OS2.EXE. The changed PROTSHELL
line should look something like this (it should all be on one
line):
PROTSHELL=C:\OS2\PMSHELL.EXE C:\OS2\OS2.INI
C:\OS2\OS2SYS.INI C:\4OS2\4OS2.EXE
Do not change PMSHELL.EXE to 4OS2.EXE. Change only the name
and path of CMD.EXE.
Now change the SET COMSPEC line so that it also contains the
full path of 4OS2.EXE. The completed line should look like
this:
SET COMSPEC=C:\4OS2\4OS2.EXE
Verify that the changes have been made correctly and then save
the CONFIG.SYS file. Exit from your editor, shut down OS/2,
and reboot your system.
Manual Installation for OS/2 Version 2.0
Use an ASCII-format editor to load and edit your OS/2
CONFIG.SYS file. In the file, you will find a line that
begins with the words SET OS2_SHELL and another that begins
with the words SET COMSPEC. The lines should look something
like this, but they may not be adjacent in the file:
SET OS2_SHELL=D:\OS2\CMD.EXE
SET COMSPEC=D:\OS2\CMD.EXE
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 7
CHAPTER 1 / INSTALLATION
___________________________________________________________________
Change both of these lines so that they to point to 4OS2.EXE,
including its path, instead of to the CMD.EXE file. When you
are done, the lines should look something like this:
SET OS2_SHELL=C:\4OS2\4OS2.EXE
SET COMSPEC=C:\4OS2\4OS2.EXE
Verify that the changes have been made correctly and then save
the CONFIG.SYS file. Exit from your editor, shut down OS/2,
and reboot your system.
4OS2 Files and Directories
The automated installation procedure places all 4OS2 files in
a single directory. You may move the files to different
directories, if you wish. But you do have to make sure that
the files can be found by the programs that need to use them.
The following information will help you set up your system
correctly if you are performing a manual installation:
4OS2.EXE is the 4OS2 program file. It must be in the
directory specified in the PROTSHELL= (OS/2 version 1.x),
SET OS2_SHELL= (OS/2 version 2.0), and SET COMSPEC= lines
in your CONFIG.SYS file as explained above.
4OS2.INF contains the text for the 4OS2 HELP command and
F1 key. For HELP to work properly, the directory
containing this file must be included in the BOOKSHELF
environment variable, which is usually set with a SET
BOOKSHELF= command in CONFIG.SYS. If you prefer, you can
move this file into the standard OS/2 bookshelf
directory, \OS2\BOOK.
4OS2H.MSG contains the help text for the "/?" option
available as part of each 4OS2 internal command. For
this feature to work properly, the directory containing
this file must be included in the DPATH environment
variable, which is usually set with a SET DPATH command
in CONFIG.SYS. If you prefer, you can move this file
into the standard OS/2 directory for such files,
\OS2\SYSTEM.
SHRALIAS.EXE is a small utility that saves the shared
alias and history list between 4OS2 sessions. The
directory containing this file should be listed in your
PATH statement. If it is not, you will have to specify
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 8
CHAPTER 1 / INSTALLATION
___________________________________________________________________
the full path name to load SHRALIAS.EXE each time you
want to use it.
Uninstalling 4OS2
In the extremely unlikely event that you have trouble with
your computer after you install 4OS2, you can remove it quite
easily. We don't expect you to have any trouble, but we know
some people feel more secure knowing how to uninstall a
product as well as install it. Or, you may need to remove
4OS2 from one system if you are moving it to another system.
To remove 4OS2 from your system temporarily, use an ASCII
editor to edit your OS/2 CONFIG.SYS file. You will need to
edit both the SET COMSPEC line (all versions of OS/2) and
either the PROTSHELL line (OS/2 version 1.x) or SET OS2_SHELL
line (OS/2 version 2.0). In all cases, change the reference
to 4OS2.EXE to the complete path and filename of CMD.EXE.
Save the file, exit from your editor, shut down OS/2, and
reboot your system. OS/2 will boot using CMD.EXE as its
command processor.
To remove 4OS2 permanently, follow the instructions above.
You will also want to change or delete any Group Main
selections (in OS/2 version 1.x) or icons (in OS/2 version
2.0) that refer directly to 4OS2.EXE. Then delete all 4OS2
files on your hard drive to completely uninstall 4OS2.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 9
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
CHAPTER 2 / GENERAL CONCEPTS
This chapter contains information about OS/2 and 4OS2. Some of the
information is general and introductory in nature; other parts of
this chapter are fairly detailed and technical. We encourage you
to at least scan through this chapter to see what is here and to
study the sections that appear to have relevance to your way of
using 4OS2 and OS/2.
Terminology
Throughout this manual, the term "desktop" refers to the
Presentation Manager in OS/2 version 1.x or the Workplace
Shell in OS/2 version 2.0.
The term "icon" refers to a selectable item on your desktop,
whether or not the corresponding icon is actually visible (you
may have chosen to configure the desktop with only session
names visible, rather than the icons themselves). For
example, the standard desktop for all versions of OS/2
includes icons titled "OS/2 Window" and "OS/2 Full Screen."
The term "session" refers to the OS/2 session created by
selecting an icon on the desktop. Sessions run a program or
sequence of programs. See below for more information on
sessions and session types. When you double-click on an icon
or select it with the keyboard and press Enter, a new session
is started.
The term "process" refers to a single invocation of a
particular program within a session. Many sessions run only a
single process. However, multiple processes can run
simultaneously within the same session. For example, in a
4OS2 session which is running a character-mode text editor,
two processes are running: 4OS2 and the text editor.
OS/2 Sessions and Applications
OS/2 supports several different types of applications and many
methods for starting them. Most of the time, you don't need
to worry about these differences because 4OS2 and OS/2
cooperate to take care of them for you. You may, however,
find this general discussion of applications and sessions
useful to understand what happens when you run an application
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 10
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
or other external program. If you need more details, see the
OS/2 online reference information.
Technical experts will recognize that these explanations are
not precise, but they should serve as a useful introduction
for many users. (For example, this introduction does not
explore the distinction between sessions and screen groups.)
Sessions and Session Types
OS/2 programs are run in "sessions" which are programs or
groups of programs whose output typically appears in specific
windowed display areas on the desktop ("windowed" sessions) or
takes up the whole screen ("full-screen" sessions).
A windowed session runs on the desktop in a graphical window
whose size you (or an OS/2 application) can change. As a
result, portions of the session's display area may be covered
or invisible at any given time. The "active" session, or the
session that receives keystrokes, is always shown with a
highlighted title bar.
Full-screen sessions run on a standard text mode display,
generally 80 characters by 25 lines. When such a session is
active, its full display area is visible and it hides all
other sessions and the desktop itself. You can use the Alt-
Esc key to switch back to the desktop from a full-screen
session.
OS/2 supports ten different types of sessions:
OS/2 Presentation Manager (PM) session: A PM session
runs in graphics mode on the desktop. PM sessions are
always windowed. Their output is graphical and may
include pictures and a variety of fonts within the same
window. Examples of PM sessions include those started to
view the OS/2 Command Reference, or to run the System
Editor distributed with OS/2.
OS/2 character mode, full-screen session: This session
type displays only text in character mode, like a
standard DOS application. It uses the entire screen,
almost always in standard 80 x 25 text mode. Examples
include a 4OS2 or CMD.EXE full-screen session.
OS/2 character mode, windowed session: This session type
is just like the character mode full-screen session
except that it runs in a window. It uses the same text
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 11
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
font over the entire window and does not display
graphics. Examples include a 4OS2 or CMD.EXE windowed
session.
DOS full-screen session: A DOS session runs DOS within
OS/2. A special version of DOS, designed to run in such
a session, is supplied with OS/2 and is generally
compatible with MS-DOS 4.0 (in OS/2 version 1.x) or MS-
DOS 5.0 (in OS/2 version 2.0). A DOS full-screen session
has full control of the screen (including the ability to
switch it into graphics and non-standard text modes). In
OS/2 version 1.x, you can start exactly one DOS session,
called the DOS Compatibility Box. Once this session is
started, it cannot be closed (although you can switch
back to the desktop with Alt-Esc). In OS/2 version 2.0,
you can start many such sessions, which are called
Virtual DOS Machines (VDMs). VDMs can normally be
terminated with the EXIT command. You can switch a full-
screen DOS session into windowed mode by pressing Alt-
Home. One example of a DOS full-screen session is the
session started by the default "DOS full-screen" icon
which is installed automatically with OS/2.
DOS windowed session: Available only in OS/2 version
2.0, this session is similar to a DOS full-screen
session, but runs in a window on the desktop. Such a
session always runs as a VDM and can normally be
terminated with the EXIT command. You can switch a
windowed DOS session into full-screen mode by pressing
Alt-Home. A DOS windowed session can run all text-mode
DOS applications, and applications that display graphics
in standard graphics video modes.
Native DOS full-screen session: Native DOS sessions are
only available in OS/2 version 2.0. They are similar to
the DOS sessions described above, but load a specific
version of DOS (for example, MS-DOS 3.3) into a VDM,
rather than the version of DOS shipped with OS/2 version
2.0. Like normal DOS sessions, native DOS sessions can
be switched between full-screen and windowed mode by
pressing Alt-Home. Once a native DOS session is started,
it cannot be terminated with the EXIT command. The only
way to terminate such a session is to switch it to
windowed mode, bring up the system menu for the window,
click Close, and then click Yes to the following prompt.
For more information on native DOS sessions, see the
command VMDISK and the topic "Starting a Specific Version
of DOS" in the on-line Command Reference for OS/2 version
2.0.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 12
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
Native DOS windowed session: This session is similar to
a native DOS full-screen session, but it runs in a window
on the desktop instead of in full-screen mode.
Windows full-screen session: This session type is
available only in OS/2 version 2.0. A Windows full-
screen session is essentially a DOS full-screen session
that is running the special version of Microsoft Windows
that is supplied with OS/2 version 2.0. It has the
standard Windows display, the Program Manager and Control
Panel, etc., and can run Windows applications, but it
cannot start OS/2 or DOS applications.
WIN-OS/2 full-screen session: This session type is
available only in OS/2 version 2.0. It is similar to a
Windows full-screen session, but runs only a single
application. Internally, it starts a DOS session, tells
DOS to load the special version of Windows that comes
with OS/2, and tells Windows to load the application.
However, no DOS character-mode window is opened for this
session -- only a full-screen window for the Windows
application.
WIN-OS/2 windowed session: This session type is
available only in OS/2 version 2.0. It allows a single
Windows application to run inside a window on the
Workplace Shell desktop. Internally, it loads the
application just like a WIN-OS/2 full-screen session.
However, the window it opens is a graphical Presentation
Manager window for the Windows application. This session
type is sometimes called a "seamless Windows" session.
Applications and Application Types
OS/2 and 4OS2 support six different types of applications.
Application types are related to the type of session in which
the application can run. They are similar to, but not the
same as, session types. The type of an application is
determined by the programmer who creates the program.
Information about the application type is embedded in the
application itself.
The application types are:
OS/2 Presentation Manager application: Runs in a PM
session only. Examples include the OS/2 online help
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 13
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
program VIEW.EXE and the System Editor distributed with
OS/2.
OS/2 character mode, full-screen application: Runs in a
full-screen OS/2 session only. Applications of this type
are very rare.
OS/2 character mode, window-compatible application: Runs
in a full-screen or windowed OS/2 session. Most OS/2
character-mode applications -- including 4OS2 -- are in
this category. This and the previous type are sometimes
called "VIO" or "AVIO" applications.
DOS application: Runs in a DOS session only. Examples
include all .COM and .EXE files designed to run under
DOS, such as those for your DOS communications program or
word processor. Virtually all DOS application programs
that use text displays will run in either a full-screen
or windowed DOS session. Many DOS applications that use
graphics will run properly only in a full-screen DOS
session. 4OS2 also recognizes DOS batch files with a
.BAT extension as DOS applications.
"Bound application" or "Family-mode application": Runs
in an OS/2 or a DOS character mode session from the same
.EXE file. Bound applications are primarily used in
compilers and installation programs to allow the same
file to run under both DOS and OS/2.
Windows application: Runs only in a Windows session.
Examples include applications like Word for Windows and
Corel Draw. Most Windows applications will run properly
in either a Windows full-screen session, or a WIN-OS/2
full-screen or windowed session.
Starting Sessions and Applications
Before you can start an application program to do some work,
you must have a session in which to execute it. Every icon on
the OS/2 desktop represents a potential session: if you
double-click the icon or select it and press Enter, OS/2
starts a new session with the parameters that have been set up
for that icon.
The parameters for the icon may cause the session to run an
OS/2 application program, load the OS/2 command processor
(CMD.EXE by default, or 4OS2 if you have it installed) and
display a prompt, run a batch file that could in turn start
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 14
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
other sessions, or start DOS, Windows, or a Windows
application.
To start 4OS2, you must define an icon for an OS/2 character
mode session, either full-screen or windowed. To do so, see
Chapter 4 / Options and Tuning (page 32) for full
instructions. Briefly, after you have installed 4OS2 and
defined it as your shell in your CONFIG.SYS file, you merely
have to place an asterisk [*] in the field for the program
name. (If CONFIG.SYS has not yet been set up for 4OS2, you
must explicitly specify the full path and name of 4OS2.EXE
instead of using the [*].)
Once 4OS2 has started, you can start applications or other
sessions from the 4OS2 prompt. When you start an application,
4OS2 checks its type. If the type is the same as that of the
session in which 4OS2 is running (which will only happen for
OS/2 character-mode applications), the application will run in
the same session as 4OS2. 4OS2 will wait for the application
to complete before displaying a new prompt. This is analogous
to how applications are run in DOS.
If the application type is different from the 4OS2 session
type, 4OS2 will start a new session to run the application.
Then 4OS2 will wait for that session to signal completion
before returning to the prompt. If 4OS2 is running in a
window, the 4OS2 window will be minimized while the new
session is running, and restored to its original state when
the new session finishes. You can also force 4OS2 to start a
new session and not wait for it to complete by using the START
command (see page 55).
Creating and Configuring Icons
This section gives you basic information which you will need
to create and configure 4OS2 and 4DOS icons on your OS/2
desktop. For complete details on creating and configuring
icons, see your OS/2 documentation. For details on the
appropriate properties or settings to use for 4OS2 and 4DOS
icons see pages 33 (4OS2) and 37 (4DOS).
OS/2 Version 1.x Icons
In OS/2 version 1.x, icons are displayed within groups on the
desktop. For example, the "OS/2 Full Screen" icon normally
appears in Group-Main.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 15
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
To create a new icon, switch to the group where you want the
icon to appear and choose the New selection on the File menu.
Then adjust the icon's properties.
To adjust the properties of an icon, first select it (click on
the icon once, or use the arrow keys on the keyboard), then
open the File Properties menu from the menu bar. From within
this menu you can modify the program name, startup directory,
command line parameters, and other configuration data for the
icon.
OS/2 Version 2.0 Icons
In OS/2 version 2.0, icons may appear on the desktop itself or
within folders. For example, the "OS/2 Full Screen" icon
normally appears in the "Command Prompts" folder.
To create a new icon, switch to the folder where you want the
icon to appear and either copy an existing icon (use either
the Copy or Create Another selection on the icon's popup menu)
or drag a Program Template in from the Templates folder.
Depending on the copying method you choose, the Settings
notebook may open automatically.
To adjust the properties of an icon, you must open its
Settings notebook. To do so, click the right mouse button in
the icon. When the popup menu appears, click the left mouse
button on the small arrow to the right of the Open selection,
then again on the Settings selection on the submenu.
Once the Settings notebook is open, use the Program page to
modify the program name, startup directory, and command line
parameters. The Session page lets you set the session type.
Other pages let you adjust other configuration data for the
icon.
The contents of the Settings notebook will vary depending on
the type of icon and the session type set on the Session page.
For example, DOS and Windows sessions allow control of a wide
variety of DOS parameters (such as available XMS and EMS
memory, whether DOS is loaded high, and the maximum number of
open files) using the "DOS Settings" or "Windows Settings"
button on the Session page. However, this button cannot be
used for Presentation Manager or OS/2 character-mode sessions.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 16
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
Primary and Secondary Shells
Primary and secondary shells are used a little differently
under OS/2 than you may be used to under DOS. In particular,
primary shells are more common in OS/2 and secondary shells
are less common.
When you boot DOS, there is only one primary shell: the one
loaded when your system boots. Under OS/2, a new primary
shell starts whenever a new character-mode session is started.
If the session is an OS/2 session, a 4OS2 (or CMD.EXE) primary
shell is used. If it is a DOS or Windows session, a 4DOS (or
COMMAND.COM) primary shell is used.
Secondary shells are used most often under DOS for "shelling
to DOS" from an application, and for starting DOS sessions
under multitaskers or task switchers like Back & Forth,
DESQview, or Microsoft Windows. Most OS/2 applications don't
offer a "shell to OS/2" capability, and new sessions create
primary, not secondary shells. As a result, 4OS2 secondary
shells are generally created only for pipes (see page 24), or
if you start a second copy of 4OS2 directly from the command
prompt.
High Performance File System (HPFS)
OS/2 version 2.0 includes support for two different file
systems. The first is the traditional DOS file system that is
based on a file allocation table (FAT) and has file names that
are composed of 8 characters plus a 3-character extension.
The second file system is called the High Performance File
System or HPFS. In this system, file names can be a maximum
of 255 characters. The names may include spaces and other
characters that are not allowed in the FAT file system.
The file system type (FAT or HPFS) is determined when a hard
disk partition is formatted, and applies to the entire
partition. For example, you might have a 200 MB hard disk
divided into four 50 MB partitions, with the first three
partitions (C:, D:, and E:) formatted for the FAT file system
and the fourth (F:) formatted for HPFS. Partition F: would
then be available only from OS/2 sessions (including DOS
sessions running under OS/2). It would not be visible from a
DOS boot outside of OS/2.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 17
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
4OS2 is compatible with both file systems. Any command that
accepts file names will accept both FAT-compatible names and
HPFS-compatible names. If an HPFS-compatible name includes
spaces or other characters that would not be allowed in a FAT
name, you must place double quotes around the entire name.
For example, suppose you have a file named LET3 on a FAT
partition, and you want to copy it to the LETTERS directory on
drive F:, an HPFS partition, and give it the name LETTER TO
SARA. To do so, use either of these commands:
[c:\wp] copy let3 f:\"letter to sara"
[c:\wp] copy let3 "f:\letter to sara"
Note that the quotes can include the filename only, or the
entire path. As long as the portion of the filename that
includes spaces or other similar separator characters is
quoted, the filename will be interpreted properly.
You can use the DESCRIBE command to add descriptions to files
on an HPFS partition, just as you can on a FAT partition.
This may mean you use two sets of quotes in the DESCRIBE
command, for example (enter this command on one line):
[c:\wp] describe "f:\letter to sara" "letter to sara
rimaldi about purchases"
If quotes are required to delimit the HPFS file name, 4OS2
will include them in the DESCRIPT.ION file. This keeps the
file name and description properly separated from each other.
4DOS will not display or modify descriptions for files with
quoted HPFS names, but will not disturb the descriptions 4OS2
creates for these files.
HPFS is called an "installable file system" (installed with
the IFS= directive in CONFIG.SYS). OS/2 supports additional
installable file systems. 4OS2 will work properly with any
installable file system which supports standard OS/2 file
access calls.
Extended Attributes
DOS allows you to define a limited set of attributes for
files, for example whether the file is Read-Only, Hidden, or
System (for more information see pages 47 - 48 of the 4DOS
manual). OS/2 supports a new type of information about files
called "Extended Attributes" or "EAs".
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 18
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
The Extended Attributes for a file provide additional
information which is not part of the file's actual contents.
This information might include the icon to be displayed for
the file on the OS/2 desktop or the type of data contained in
the file.
OS/2 supports Extended Attributes on both FAT and HPFS
partitions. EAs for the files on a FAT partition are stored
in the file "EA DATA. SF" in the partition's root directory.
Like CMD.EXE, 4OS2 preserves a file's EAs when copying or
moving the file, and makes the appropriate adjustments to EAs
when a file is deleted or renamed.
If you boot in DOS mode (as opposed to a DOS session under
OS/2) and delete or otherwise manipulate files that have
Extended Attributes, you can face several unexpected problems
when you next boot under OS/2 because the EAs and directories
will be out of sync. If you must manipulate files with
Extended Attributes during a DOS boot, make sure you run
OS/2's CHKDSK program the next time you boot OS/2.
For more information on Extended Attributes, see your OS/2
documentation.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 19
CHAPTER 3 / USING 4OS2
___________________________________________________________________
CHAPTER 3 / USING 4OS2
In use, 4OS2 is nearly identical to 4DOS. The few differences are
explained in this chapter. We have assumed in this chapter that
you have the 4DOS Reference Manual available and that you have some
familiarity with the corresponding 4DOS features.
If a section of this chapter seems completely unfamiliar to you, it
is probably discussing a feature of 4DOS and 4OS2 that you are not
using. Feel free to read only the sections of this chapter that
are relevant to the way that you use your computer and 4OS2.
At the Command Line
[see page 55 in the 4DOS Reference Manual]
The 4OS2 command line will hold a maximum of 511 characters,
instead of the 255 characters available at the 4DOS command
line. All other command line editing features work the same
under 4OS2 as they do under 4DOS.
The default 4OS2 prompt is [$p] on hard disk partitions and
[$n] on floppy disks, rather than the corresponding defaults
of $p$g and $n$g in 4DOS. This default is compatible with
CMD.EXE, and encloses the current path or drive in square
brackets. When OS/2 is installed, it inserts a SET PROMPT
statement in CONFIG.SYS to set the prompt to $i[$p]. This
prompt will override 4OS2's default (it will not affect 4DOS).
The $i adds a header line to the default prompt, to remind you
of certain OS/2 keystrokes. You can modify or delete the SET
PROMPT line in CONFIG.SYS if you want to use a different
prompt for your 4OS2 sessions.
For compatibility with CMD.EXE, 4OS2 will prompt for
additional command line text when you include a caret [^] as
the very last character of a typed command line. For example:
[c:\] echo The quick brown fox jumped over the lazy^
More? sleeping dog. > alphabet
4OS2 HELP
Complete on-line help for all 4OS2 commands and features is
provided with 4OS2. As in 4DOS, help is invoked with the HELP
command or the F1 key. 4OS2's help text does not cover the
OS/2 external commands because they are included in OS/2's
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 20
CHAPTER 3 / USING 4OS2
___________________________________________________________________
built-in Command Reference. The OS/2 Command Reference is
normally displayed along with 4OS2's help when the HELP
command or F1 key is used. You can also use the 4OS2 HELP
command for explanations of OS/2 error messages (see page 52).
When you start the 4OS2 Help system, 4OS2 opens a new OS/2
Presentation Manager session to run VIEW.EXE, the standard
help program supplied with OS/2. VIEW displays the 4OS2 Help
and OS/2 Command Reference information and lets you browse
through it.
If you invoke VIEW from a windowed 4OS2 session, you will be
returned to that session when you are done with VIEW. If you
invoke VIEW from a full-screen session, you must manually
return to that session using standard OS/2 methods for
switching between sessions (this is due to the design of OS/2,
and is not a limitation within 4OS2).
You can also keep the VIEW help window on the screen and
return to the 4OS2 session, switching between the two sessions
as needed. This may be useful when you are writing a batch
file, working on a complex command, or experimenting with
4OS2.
4OS2 also supports the /? switch to display help for any
command. For more information see your 4DOS reference manual
and the information on the 4OS2H.MSG file on page 8 of this
manual. See page 36 for information about configuring 4OS2
help.
Shared History and Alias Lists
[see pages 57 and 94 in the 4DOS Reference Manual]
By default, 4OS2 will use the same history list and alias list
in all sessions and in both primary and secondary 4OS2 shells.
It keeps these lists in shared memory segments. This means
that the aliases that you define in one session will be
available immediately in copies of 4OS2 that are running in
other sessions. In addition, the history list, which is used
to record the commands that you type, is updated in all 4OS2
sessions whenever you type a command at any 4OS2 prompt.
If you want to start a 4OS2 shell or session with unique alias
and history lists, use the LocalAliases and LocalHistory
directives in the 4OS2.INI file (see page 35) or on the 4OS2
command line (see page 33). Using the 4OS2.INI directive is
the best choice if you want to have separate alias and history
lists for all 4OS2 sessions. You might prefer using the
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 21
CHAPTER 3 / USING 4OS2
___________________________________________________________________
command line directive if you want to create a separate list
just for one particular session or shell.
The memory segments that contain the shared history and alias
lists are retained as long as there is at least one copy of
4OS2 running that supports shared lists. When all such copies
of 4OS2 end, the shared history and alias lists are discarded.
A utility program called SHRALIAS.EXE is included on the 4OS2
distribution diskette. It will keep these lists open until
your computer is rebooted. To use this program, include the
following line in your STARTUP.CMD, 4START, or 4OS2 session
startup batch file:
[d:\path\]shralias
Once SHRALIAS is started, it will remain active until your
computer is turned off or rebooted, even if the session from
which it was started is terminated. To deactivate SHRALIAS,
enter this command at any 4OS2 prompt:
[d:\path]shralias /u
Special Characters
To maintain compatibility with CMD.EXE, the default values for
three special characters are different in 4OS2 than in 4DOS.
If you want to share batch (.BTM) files or aliases between
4OS2 and 4DOS, you will probably want to select a common set
of characters for both environments. You can do so with
directives in 4OS2.INI or 4DOS.INI, or by using the SETDOS
command.
By default, the command separator is an ampersand [&] in 4OS2
and a caret [^] in 4DOS (see page 62 in the 4DOS Reference
Manual). You can select a common command separator character
with the CommandSep directive or the SETDOS /C command.
The default escape character is a caret [^] in 4OS2 and Ctrl-X
in 4DOS (see page 91 in the 4DOS Reference Manual). You can
select a common escape character with the EscapeChar directive
or the SETDOS /E command.
4OS2 batch files and aliases recognize the dollar sign [$] to
mean all or all remaining replaceable parameters (e.g., %$ or
%2$). The corresponding symbol in 4DOS is the ampersand [&]
(see pages 44 and 75 in the 4DOS Reference Manual). You can
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 22
CHAPTER 3 / USING 4OS2
___________________________________________________________________
select a common symbol with the ParameterChar directive or the
SETDOS /P command.
Executable File Names
[see pages 44 and 75 in the 4DOS reference manual]
4OS2 is similar to 4DOS in the way it executes programs and
batch files. It searches for .COM, .EXE, .BTM, and .CMD
files, and files with executable extensions, in the current
directory and then in each directory in the PATH. In
addition, 4OS2 will execute any file which contains an
executable application program even if it does not have the
standard .COM or .EXE extension.
Such a file will be found only if you give its extension
explicitly. For example, if you had an executable file in the
current directory called WORKOUT.PGM you could run it by
typing that name (with the extension), but not by simply
typing WORKOUT.
Redirection
[see page 66 in the 4DOS Reference Manual]
In addition to the extended 4DOS redirection options, 4OS2
also supports the OS/2 (CMD.EXE) syntax
n>file
and
n>&m
where [n] and [m] are digits between 0 and 9. You may not put
any spaces between the n and the >, or between the & and the m
in the second form. The digits represent file handles; OS/2
interprets "0" as STDIN (standard input), "1" as STDOUT
(standard output), and "2" as STDERR (standard error).
Handles 3 to 9 will probably not be useful unless you have an
application which uses those handles for a specific,
documented purpose.
The n>file syntax redirects output from handle n to a file.
You can use this form to redirect two handles to different
places. For example,
[c:\] dir >outfile 2>errfile
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 23
CHAPTER 3 / USING 4OS2
___________________________________________________________________
sends normal output to a file called OUTFILE and any error
messages to a file called ERRFILE.
The n>&m syntax redirects handle n to the same location as the
previously assigned handle m. For example, to send STDERR to
the same file as STDOUT, you could use this command:
[c:\] dir >outfile 2>&1
Notice that you can perform the same operations by using
4OS2's enhanced redirection features. The two examples above
could be written as
[c:\] dir >outfile >&>errfile
and
[c:\] dir >&outfile
Piping
[see page 68 in the 4DOS Reference Manual]
A pipe takes the standard output of one program (the sending
program) and uses it as the standard input of a second program
(the receiving program). Because of the limitations of MS-
DOS, 4DOS implements pipes by creating a temporary file to
collect the output from the sending program. Once that
program is done, 4DOS starts the receiving program and sends
it the contents of the temporary file as its input. When the
receiving program ends, 4DOS deletes the temporary file.
The flexibility of OS/2 lets 4OS2 implement pipes by starting
a new process for the receiving program. The sending and
receiving programs run simultaneously; the sending program
writes to the pipe and the receiving program reads from the
pipe. When both programs finish, the process for the
receiving program is ended automatically.
If you are used to using pipes under 4DOS, you normally will
not see any difference with a 4OS2 pipe except perhaps less
disk activity. But you may not get the results you expect
from 4OS2 if you use a pipe command like:
[c:\] echo test | input %%var
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 24
CHAPTER 3 / USING 4OS2
___________________________________________________________________
In 4DOS, this pipe will create an environment variable called
VAR and set its value as "test." You will be able to see the
new variable by typing SET at the 4DOS command.
In 4OS2, VAR will be set in the environment that belongs to
the receiving program. But that environment will be discarded
when the pipe has been emptied and the process ends. You will
never see VAR in the environment even though 4OS2 and OS/2 are
both operating correctly.
The same cautions apply to the "pipe-fitting" commands, TEE
and Y. When you use pipes with 4OS2, make sure you think
about any possible consequences that can occur from using a
separate process to run the receiving program.
Because 4OS2 does not use temporary files for pipes, the TEMP
and TEMP4DOS environment variables do not affect pipes in 4OS2
as they do in 4DOS.
4OS2 Internal Variables
[see page 79 in the 4DOS Reference Manual]
The following internal variables are unique to 4OS2:
_PID is the current process ID number.
_PPID is the process ID number of the parent process.
_SID is the session ID number.
_PTYPE is the current OS/2 process type:
AVIO Character mode, windowed
DT Detached (no screen in use)
FS Character mode, full-screen
PM Presentation Manager
The following 4DOS internal variables are not available in
4OS2:
_ALIAS (because 4OS2 dynamically sizes the alias list).
_DV (because DESQView does not run under OS/2).
_ENV (because 4OS2 dynamically sizes the environment).
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 25
CHAPTER 3 / USING 4OS2
___________________________________________________________________
_WIN (because Windows does not run in the OS/2 character-
mode sessions used to run 4OS2).
One 4DOS internal variable has additional options in 4OS2:
%_VIDEO returns two additional video adapter types not
detectable under DOS: "IA/A" for the IBM PS/2 Image
Adapter/A, and "XGA" for IBM the PS/2 XGA.
4OS2 Variable Functions
[see page 83 in the 4DOS Reference Manual]
The following variable functions are available only in 4OS2:
@EXETYPE[filename]: Returns the application type as a
string:
DOS DOS .COM, .EXE, or .BAT file (OS/2 2.0
only)
AVIO OS/2 Character mode, windowed
FS OS/2 Character mode, full-screen
PM OS/2 Presentation Manager
WIN Windows 3 (OS/2 2.0 only)
@FSTYPE[d:]: Returns the file system type for the
specified drive. Normally, it will return "FAT" for a
DOS-compatible drive with a file allocation table or
"HPFS" for a drive that uses OS/2's high performance file
system. Other values may be returned by any additional
file systems installed with the IFS= directive in
CONFIG.SYS.
The following 4DOS variable functions are not available in
4OS2:
@EMS (because OS/2 does not recognize nor use expanded
memory).
@EXTENDED (because OS/2 does not recognize extended
memory as a special memory type).
@LPT (because there is no feasible way to read printer
status information directly under OS/2).
@REMOVABLE (because there is no feasible way to detect
removable drives under OS/2)
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 26
CHAPTER 3 / USING 4OS2
___________________________________________________________________
@TRUENAME (because there is no feasible way to detect
true names under OS/2).
@XMS (because OS/2 does not recognize nor use XMS
memory).
Also, in 4OS2 the @DOSMEM function returns the size of the
largest block of free memory, not the total amount of free
memory (because total free memory is not an available or
meaningful value under OS/2).
Batch Files
4OS2 can execute two kinds of batch files: files with an
extension of .CMD and those with an extension of .BTM. The
former are traditional OS/2 batch files; the latter can be
run by 4OS2 and by 4DOS running either under DOS or in a DOS
session under OS/2.
If you run the same .BTM files with 4OS2 and 4DOS, you should
encounter few difficulties. However, 4OS2 and 4DOS by default
use a different command separator, a different escape
character, and a different character for all remaining
parameters on a batch file or alias command line. You may
want to use the CommandSep, EscapeChar, and ParameterChar
directives in either 4OS2.INI or 4DOS.INI, or the
corresponding SETDOS switches, to set the same characters in
both products (see page 23).
Inside a .BTM file, you may need to determine whether the file
is being executed by 4OS2, by 4DOS running under DOS, or by
4DOS in an OS/2 DOS session. You may also want the file to
do different things in primary and secondary shells.
The template on the following page should help you write .BTM
files that can run successfully in each possible environment.
It includes detection of several different environments but
does not cover all possibilities. The basic rule is to use
the internal variable %_DOS to determine the operating system,
%_DOSVER to determine the operating system version, and
%_SHELL to determine the shell level. Note that in a DOS
session, %_DOSVER returns 3.3, 5.0, etc. for the corresponding
MS-DOS versions, 10.2 or 10.3 for the OS/2 version 1.2 or 1.3
DOS Compatibility Box, and 20.0 for an OS/2 version 2.0 VDM.
In an OS/2 session, %_DOSVER returns the true OS/2 version
(e.g., 1.2 or 2.0).
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 27
CHAPTER 3 / USING 4OS2
___________________________________________________________________
[commands here for both 4OS2 and 4DOS]
iff "%_DOS" == "DOS" then
[commands here for all 4DOS shells]
iff %_DOSVER == 20.0
[commands here for OS/2 2.0 VDMs]
endiff
iff %_SHELL == 0
[commands here for 4DOS primary shells]
endiff
else
[commands here for all 4OS2 shells]
iff %_DOSVER == 1.3
[commands here for 4OS2 under OS/2 1.3]
elseiff %_DOSVER == 2.0
[commands here for 4OS2 under OS/2 2.0]
endiff
iff %_SHELL ne 0
[commands here for all 4OS2 secondary shells]
endiff
endiff
4OS2 Startup and Exit Files
4OS2 uses three startup or exit batch files: STARTUP.CMD,
4START, and 4EXIT. STARTUP.CMD is run automatically whenever
OS/2 starts. 4START is run whenever 4OS2 starts, and 4EXIT is
run whenever 4OS2 exits. 4START and 4EXIT can be either .CMD
or .BTM files. If they have the extension .BTM and are in a
directory where 4DOS can find them, they will also run
whenever 4DOS starts and exits.
Using STARTUP.CMD
If you have a STARTUP.CMD file in the root directory of your
OS/2 boot drive, OS/2 will automatically create a windowed
4OS2 session when the system boots and will tell that session
to execute STARTUP.CMD. (This is a feature of OS/2 and does
not depend on 4OS2. If CMD.EXE is your OS/2 command processor
it will be used to run STARTUP.CMD.)
You can use STARTUP.CMD to start other sessions, to set up a
global alias list, start SHRALIAS, etc., just as you might use
AUTOEXEC.BAT under DOS. STARTUP.CMD will be executed once,
when your system boots, not every time a 4OS2 session is
started.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 28
CHAPTER 3 / USING 4OS2
___________________________________________________________________
If you place the command EXIT at the end of STARTUP.CMD, the
session created to run STARTUP.CMD will end when that command
is executed, and any global alias list will be discarded if no
other 4OS2 session has been started and SHRALIAS has not been
loaded (see page 22). If you don't include an EXIT, the
session will remain open and can be used as a normal windowed
4OS2 session.
Using 4START and 4EXIT
If you create a 4START.BTM and 4EXIT.BTM file, you can use
them for both 4OS2 and 4DOS. The template above shows how to
include commands that are specific to each operating system.
If you prefer to use different files for 4OS2 and 4DOS, you
can use 4START.CMD for 4OS2 and 4START.BAT for 4DOS. You
could name your 4EXIT files similarly. You can also keep the
4START and 4EXIT files separate by placing the files for 4OS2
in the 4OS2 directory and the files for 4DOS in the 4DOS
directory.
If you prefer, you can create a file with a name other than
4START (for example, STARTOS2.CMD) and put its name in the
Parameters field for any 4OS2 icon (see page 32). Doing so
has two advantages. The file will only be started when a
primary 4OS2 shell is started, not under a secondary shell or
under 4DOS. Also, you can then use different startup files
for different 4OS2 sessions. Note that this file will not be
run by the "automatic" session that OS/2 starts at boot time
to run STARTUP.CMD. If you want it to run at that time also,
you will have to CALL it from STARTUP.CMD.
REXX Support
REXX is a file and text processing language developed by IBM
and included within OS/2. REXX files have a .CMD extension,
just like normal batch files, but the first two characters in
the file are always [/*], which indicate the beginning of a
REXX comment.
4OS2 checks to see if the first two characters on the first
line of a .CMD file are [/*]. If so, it passes the file to
OS/2's built-in REXX facility for processing. Any commands in
the file that are not recognized by REXX will be passed back
to 4OS2. This allows you to embed any valid 4OS2 command
(including internal commands and aliases) within a REXX file
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 29
CHAPTER 3 / USING 4OS2
___________________________________________________________________
which is started from 4OS2. You can also force REXX to pass
commands to 4OS2 by enclosing those commands in single
quotation marks.
For more information on REXX see your OS/2 documentation.
EXTPROC Support
OS/2 also offers an external processor (EXTPROC) option for
batch files that lets you define an external program to
process a particular .CMD file.
4OS2 supports EXTPROC in the same way as CMD.EXE. To identify
a .CMD file to be used with an external processor, place the
string "EXTPROC" as the first word on the first line of the
file followed by the name of the external program that should
be called. 4OS2 will start the program and pass it the name
of the .CMD file and any command line arguments that were
entered. 4OS2 will look for the external processor in the
current directory and then in each directory in the PATH.
4OS2 will start the external processor in the current session,
if possible, and wait for it to finish. If the external
processor's application type is incompatible with the current
session, 4OS2 will begin a new session for it and wait until
that session ends before returning to the command prompt.
For example, suppose GETDATA.CMD contains the following lines:
EXTPROC D:\DATAACQ\DATALOAD.EXE
OPEN PORT1
READ 4000
DISKWRITE D:\DATAACQ\PORT1\RAW
Then if you entered the command:
[d:\dataacq>] getdata p17
4OS2 would read the GETDATA.CMD file, determine that it began
with an EXTPROC command, read the name of the processor
program, and then execute the command:
D:\DATAACQ\DATALOAD.EXE D:\DATAACQ\GETDATA.CMD p17
The hypothetical DATALOAD.EXE program would then be
responsible for reopening the GETDATA.CMD file, ignoring the
EXTPROC line at the start, and interpreting the other
instructions in the file. It would also have to respond
appropriately to the command line parameter entered (p17).
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 30
CHAPTER 3 / USING 4OS2
___________________________________________________________________
For more information on external batch file processors see
your OS/2 documentation.
Do not try to run 4OS2 or CMD.EXE as an external processor
with EXTPROC. Both programs will interpret the EXTPROC line
as a command to re-open themselves. The result will be an
infinite loop that will continue until the computer runs out
of resources and locks up.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 31
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
CHAPTER 4 / CONFIGURATION AND TUNING
[see page 107 in the 4DOS Reference Manual]
4OS2 can be configured in three different ways: with command-line
options, through its initialization file, and via the SETDOS
command. The SETDOS command is described on page 54 of this manual
and page 280 of the 4DOS Reference Manual. Command line options
and the initialization file are described in this chapter. This
chapter also discusses how to configure the 4OS2 help system and
how to use 4DOS effectively in DOS sessions.
In this chapter, we assume that 4OS2 is set up as the default OS/2
command processor in your OS/2 CONFIG.SYS file. This is normally
done when you install 4OS2. See pages 7 and 7 for information on
making these changes to CONFIG.SYS manually.
Creating and Configuring 4OS2 Icons
You can create as many 4OS2 icons as you wish on the OS/2
desktop. Different icons can be used to start 4OS2 in
different modes, with different startup commands or options,
or to run different batch files or other commands. You can
use these icons to run commonly-used commands and batch files
directly from the OS/2 desktop.
Each icon represents a different 4OS2 session and you can set
up any of these sessions to run in windowed or full-screen
mode. You can also set any necessary command line parameters
for 4OS2 such as a command to be executed, any desired
switches, and the name and path for 4OS2.INI. More
information on command line switches and options for 4OS2, and
on 4OS2.INI, is included later in this section.
For general information on creating and configuring icons, see
page 15 and your OS/2 documentation.
When you configure a 4OS2 icon, place command line parameters
that you want passed to 4OS2 (e.g., @ininame) into the
Parameters field for the icon.
To run a startup batch file for a particular 4OS2 session,
include its name (with a path, if the batch file is not in the
session's startup directory) as the last item in the
Parameters field. That batch file will be executed after any
4START file but before the first prompt is displayed. You can
use the batch file to set environment variables and execute
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 32
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
any other 4OS2 commands. You can also execute any internal
4OS2 command, external command, or alias by placing its name
in the Parameters field. When you set up a batch file or
other command to run in this way you are using the command
option (see below).
To execute an internal or external command, an alias, or a
batch file and then exit (return to the desktop) when it is
done, place /C command (rather than just command) as the last
item in the Parameters field.
4OS2 Command Line Options
The 4OS2 command line does not need to contain any
information. When invoked with an empty command line, 4OS2
will configure itself from the 4OS2.INI file, run 4START, and
then display a prompt and wait for you to type a command.
However, you may add information to the 4OS2 command line that
will affect the way it operates.
Command line options for primary shells are set in the
Parameters field of the 4OS2 icon. If you need help finding
and setting the Parameters field for your version of OS/2, see
page 15. Command line options for secondary shells can be set
using 4OS2.INI directives, or typed on the command line itself
following the program name if the shell is started from a
prompt.
4OS2 recognizes six optional fields on the command line. If
you use more than one of these fields, their order is
important. The syntax for these options is (all options go on
one line):
[d:\path] [@d:\path\inifile] [/S] [//iniline]...
[/C | /K] [command]
In this syntax statement, items in square brackets are
optional. The //iniline option may be repeated.
In the descriptions below, d: means a drive letter and \path
means a subdirectory name.
d:\path 4OS2 will use this directory and path to set the
COMSPEC environment variable for this session.
If this option is not used, COMSPEC is set from
the location of 4OS2.EXE. Since 4OS2 always
knows what drive and directory it was started
from, there is little reason to use this option.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 33
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
It is included only for compatibility with OS/2's
default shell program, CMD.EXE. This option
cannot be used for secondary shells.
@d:\path\inifile
This option sets the path and name of the
4OS2.INI file, which is discussed below. You do
not need this option if you aren't using a
4OS2.INI file. Nor do you need this option if
the file is named 4OS2.INI and it is in the same
subdirectory as 4OS2.EXE or in the root directory
of the boot drive. Otherwise, this option must
be included. This option is most useful if you
want to start a 4OS2 session with a specific and
unique INI file.
/S This option tells 4OS2 that you do not want it to
set up a Ctrl-C / Ctrl-Break handler. It is
included for compatibility with CMD.EXE, but it
may cause the system to operate incorrectly if
you use this option without other software to
handle Ctrl-C and Ctrl-Break. This option should
be avoided by most users.
//iniline This option tells 4OS2 to treat the text
appearing between the // and the next space or
tab as a 4OS2.INI directive (see below for a
discussion of 4OS2.INI). The directive should be
in the same format as a line in 4OS2.INI, but it
may not contain spaces, tabs, or comments. This
option overrides any corresponding directive in
your 4OS2.INI file. This option is a convenient
way to send 4OS2 one or two simple directives
without modifying or creating a new 4OS2.INI
file.
[/C | /K] command
This option tells 4OS2 to run a command when it
starts. The command will be run after 4START has
been executed and before any command prompt is
displayed. It can be any valid internal or
external command, batch file, or alias, and you
may include multiple commands by using the
command separator. All other startup options
must be placed before the command, because 4OS2
will treat characters after the command as part
of the command and not as additional startup
options.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 34
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
When the command is preceded by a /C, 4OS2 will
execute the command and then exit and return to
the parent program or the OS/2 desktop, without
displaying a prompt.
The /K switch has no effect; using it is the same
as placing the command (without a /C or /K) at
the end of the startup command line. It is
included only for compatibility with CMD.EXE.
Using 4OS2.INI
4OS2 uses a file of initialization information called the
4OS2.INI file. You can add to and edit this file with any
ASCII text editor to set 4OS2 options and alter the way that
4OS2 works. Most of this section explains the options
available through 4OS2.INI. You only need to include entries
in 4OS2.INI for any settings that you want to change from
their default values. If you are happy with all of the
default values, you don't need a 4OS2.INI file at all.
Some settings in 4OS2.INI are initialized when you install
4OS2, so you may have a 4OS2.INI file even if you didn't
create one yourself. You should not delete this file unless
you've checked carefully to be sure that you don't need any of
the settings the initialization program put there.
In general, the 4OS2.INI file works the same as the 4DOS.INI
file described on page 116 of the 4DOS Reference Manual. The
following paragraphs only describe the differences between the
two files and the way they are processed.
4OS2.INI Directives
The following directives are used only in 4OS2:
HelpBook = string (4OS2+CMDREF): Sets the names of the
"books" to be loaded when 4OS2 help is invoked with the
HELP command or the F1 key. The default is 4OS2+CMDREF
which loads the 4OS2 help and the OS/2 command reference.
See the next section for details about this directive.
LocalAliases = Yes | NO: Normally, 4OS2 shares one alias
list among all running shells. "Yes" forces 4OS2 to use
a local alias list for the affected session(s) instead of
a shared global list.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 35
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
LocalHistory = Yes | NO: Normally, 4OS2 shares one
history list among all running shells. "Yes" forces 4OS2
to use a local history list for the affected session(s)
instead of a shared global list.
WindowState = STANDARD | Maximize | Minimize: Sets the
state of the 4OS2 window in a windowed session.
"Standard" leaves the window where OS/2 puts it and is
the default. "Maximize" maximizes the window; "Minimize"
minimizes it. If WindowState is set to Maximize or
Minimize, you will see OS/2 briefly display the window at
the default size and position, then 4OS2 will change it
to the state you specify. This behavior is a limitation
of OS/2, not 4OS2. (To create a 4OS2 window without
seeing the window state change on the screen, use the
START command with the /POS, /MIN, or /MAX switch.)
The following 4DOS.INI directives may not be used in a
4OS2.INI file. These directives are specific to 4DOS, or to
DOS or features or limitations that do not exist in OS/2:
Alias FullINT2E StackSize
ANSI HelpOptions Swapping
AutoExecPath HelpPath SwapReopen
DiskReset LineInput UMBEnvironment
DVCleanup MessageServer UMBLoad
EnvFree NetwareNames UniqueSwapName
Environment Reduce
FineSwap ReserveTPA
Configuring 4OS2 Help
In order for the 4OS2 help system to work properly, both
VIEW.EXE and the help text file, 4OS2.INF, must be in their
proper locations. VIEW.EXE is normally stored in the \OS2
directory. This directory must be included in your PATH (as
it normally is) so that 4OS2 can find and start VIEW.
During automated installation, 4OS2.INF is copied to your 4OS2
installation directory. You can make the 4OS2 help text
available to VIEW by either moving 4OS2.INF to the standard
"book" directory shown on the SET BOOKSHELF line in CONFIG.SYS
(normally \OS2\BOOK), or by adding the 4OS2 directory to the
BOOKSHELF setting (BOOKSHELF, like PATH, contains a list of
directory names, separated by semicolons). The latter method
is the one used by 4OS2's automated installation program.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 36
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
OS/2 includes a complete reference to all internal and
external commands in the reference book named CMDREF. This
book is stored in the file \OS2\BOOK\CMDREF.INF. 4OS2
normally passes the help file name "4OS2+CMDREF" to VIEW,
which then opens the 4OS2 help text and the OS/2 command
reference. However, you can specify a different set of
"books" to be opened when HELP or F1 is invoked. To do so,
use the HelpBook directive in 4OS2.INI (see page 35).
For example, to set up 4OS2 so that only 4OS2 help is
displayed (without the CMDREF book) when F1 is pressed, you
would include the following directive in 4OS2.INI:
HelpBook=4OS2
When more than one book is listed in the HelpBook setting,
VIEW will see the combined group as a single book. The Table
of Contents displayed by VIEW will include the tables of
contents from all the listed books, concatenated together as
one group of topics with no divisions to show where one book
ends and the next begins.
If you wish, you can set up a separate icon for 4OS2 help
which can be invoked from your desktop. To do so, create an
icon with VIEW.EXE as the program name and 4OS2 in the
parameter field (use 4OS2+CMDREF to show both books when the
icon is selected).
Using 4DOS with OS/2
The combination of 4OS2 and 4DOS gives you a consistent user
interface whether you boot your computer with OS/2 or DOS, and
whether you are in OS/2 character mode or running an OS/2 DOS
session. However, to use DOS, 4DOS, and OS/2 successfully
requires some planning if you want to get all the power
possible out of each operating environment.
This section explains some of the planning you should do and
some of the techniques you can use to get everything working
together correctly. It covers:
* Setting up your OS/2 CONFIG.SYS file to use 4DOS as
the command processor for OS/2 DOS sessions in all
versions of OS/2 (see page 38).
* Configuring OS/2 version 2.0 DOS sessions (Virtual DOS
Machines) to get the most out of 4DOS (see page 40).
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 37
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
* Arranging your 4DOS.INI, 4START, 4EXIT, and
AUTOEXEC.BAT files for use in the multiple DOS
sessions available under OS/2 2.0 (see page 42).
* Setting up temporary DOS sessions in OS/2 2.0 to run a
single DOS command or application (see page 44).
* Adjusting 4DOS.INI, 4START, 4EXIT, and AUTOEXEC.BAT
when you have the ability to boot your computer under
either DOS or OS/2 using OS/2's Dual Boot or Boot
Manager features (see page 44).
Throughout this section, we assume that you want to use 4DOS
as your command processor in all of these situations, and that
you are using 4OS2 as your command processor in OS/2 character
mode sessions. Also, we assume that you have installed 4DOS
in the C:\4DOS\ directory.
If your system has a DOS boot capability (separate from OS/2),
we suggest that you first make sure you have 4DOS set up to
run properly under a standard DOS boot. Use the 4DOS
Reference Manual and the 4DOS installation program to set your
DOS-based CONFIG.SYS and AUTOEXEC.BAT files the way you want
them.
To set up 4DOS for use with OS/2 you may need some background
information on 4DOS installation and configuration options.
We've included only what's necessary here; if you want more
detail or need to refresh your memory, see Chapters 2 and 6 of
the 4DOS manual.
If you are using OS/2's Dual Boot or Boot Manager, you will
have (at least) two copies of CONFIG.SYS and AUTOEXEC.BAT on
your computer, one for booting OS/2 and OS/2 DOS sessions, and
the other for booting DOS without OS/2. See the section on
Dual Boot and Boot Manager on page 44 for details on where
these two sets of files are stored. Unless otherwise
specified, references in this section to CONFIG.SYS and
AUTOEXEC.BAT refer to the OS/2 versions of these files.
Changing the OS/2 CONFIG.SYS File
Before you make any changes to CONFIG.SYS, make sure that you
have a bootable floppy disk or your OS/2 installation disks,
so that an error won't leave your system unbootable. You're
not likely to create such an error, especially under OS/2, but
this is always a wise precaution.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 38
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
To install 4DOS as your default shell for OS/2 DOS sessions,
look for a SHELL= command in CONFIG.SYS. It will look
something like this:
SHELL=C:\OS2\MDOS\COMMAND.COM C:\OS2\MDOS /P
Change the line to refer to 4DOS rather than COMMAND.COM:
SHELL=c:\4dos\4dos.com c:\4dos [options]
The first part of that statement simply sets 4DOS.COM as your
shell program for DOS sessions. The second part specifies the
directory where 4DOS.COM is stored, which is called the
COMSPEC setting. You must include the COMSPEC setting or your
OS/2 DOS sessions may not start or work properly. In an OS/2
DOS session, 4DOS cannot determine the COMSPEC setting
automatically unless 4DOS.COM is stored in the root directory
of the boot drive.
You may want to add other 4DOS options to the command line as
well; see page 108 in the 4DOS Reference Manual.
After you have modified CONFIG.SYS, you must shut down OS/2
and reboot in order for your changes to take effect. But
before you do, read through the remainder of this section to
see if you need to make any other configuration changes.
Using 4DOS with OS/2 Version 1.x
Under OS/2 version 1.x, you can install 4DOS simply by setting
the SHELL= command in CONFIG.SYS. This command determines how
4DOS starts when you invoke the DOS Compatibility Box from the
OS/2 desktop.
You can use the [options] portion of the SHELL command to
select a special 4DOS.INI file and to set any other 4DOS
command line options you choose. In essence, you can set up
4DOS just as you would if you installed it on a DOS system
without OS/2.
You can skip the sections below which explain how to configure
DOS sessions under OS/2 version 2.0. However, if you are
using the OS/2 version 1.x Dual Boot capability, you should
read the section on Dual Boot and Boot Manager (page 44).
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 39
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
Using 4DOS with OS/2 Version 2.0
Under OS/2 version 2.0, you can have multiple icons for DOS
sessions or Virtual DOS Machines (VDMs). These may include
icons in the Command Prompts window, icons for "migrated
applications," icons for DOS and Windows applications, and
icons for batch files.
Assuming you set up your VDM icons as described here, each
time a DOS session starts 4DOS is loaded as a primary shell.
4DOS will process 4DOS.INI, execute your 4START file if you
have one, and execute AUTOEXEC.BAT. When the session is
closed with the EXIT command, 4DOS will run your 4EXIT file if
you have one. You can start any number of DOS sessions and
(within the limits of system resources) have as many running
simultaneously as you like.
This is fundamentally different from what happens when you
boot your computer under DOS or OS/2 1.x, where there is only
one 4DOS primary shell, AUTOEXEC.BAT is only executed once
each time you boot, and so on. OS/2 version 2.0 gives you a
lot more flexibility, but that flexibility requires planning
to get the most out of 4DOS.
For example, you can have all your DOS sessions use the same
AUTOEXEC.BAT file, or you can have different versions of
AUTOEXEC.BAT for different sessions. The same is true of the
other startup and exit files (4DOS.INI, 4START, and 4EXIT).
This section and the sections below discuss how to set up
icons for your DOS sessions, and how to arrange your startup
and exit files so that 4DOS will do just what you want it to
in each DOS session.
Each VDM icon contains its own information about how to start
DOS for that session. In essence, each icon has its own
CONFIG.SYS file built into it. When you create a new icon
from OS/2's default Program template, this DOS configuration
information is initialized based on your CONFIG.SYS file, or
taken from standard OS/2 DOS defaults (for settings which have
no corresponding command in CONFIG.SYS). If you create a new
icon by Copying an existing icon, the existing icon's
information will be used in the new icon.
Once an icon has been created, you can modify the DOS
configuration information by using the DOS Settings button on
the Session page in the icon's Settings notebook (see page 15
for more details on modifying the settings for an icon). Any
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 40
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
modifications you make will apply only to that icon (and
others created from it with the Copy option on the icon's
popup menu).
You can return any DOS setting for a VDM icon to its default
value by selecting the setting and clicking on the Default
button. This replaces the value of the setting with the value
that OS/2 read from CONFIG.SYS when you last booted, or with
the value from OS/2's standard defaults. Changes that you
make in CONFIG.SYS will then be reflected in the setting for
that icon each time you boot OS/2. However once you modify a
setting in a particular icon any link to the corresponding
default value in CONFIG.SYS is removed, and further changes in
CONFIG.SYS will not be reflected in the setting for that icon.
The setting labeled DOS_SHELL determines what command
processor OS/2 will load when the icon is used to start a
session. It is formatted just like the SHELL= line in
CONFIG.SYS (but without the characters "SHELL="). The
DOS_SHELL setting should always include the COMSPEC path. For
example, you might set DOS_SHELL to:
c:\4dos\4dos.com c:\4dos
Once you've set up CONFIG.SYS as described above and rebooted,
any new VDM icons you create from the default Program template
will automatically use 4DOS. However, VDM icons which existed
before you modified CONFIG.SYS may list COMMAND.COM in the
DOS_SHELL setting. To correct the setting so that 4DOS is
used for these icons, modify DOS_SHELL in each icon to point
to 4DOS, as shown in the example above, or select the Default
button for DOS_SHELL after you have modified the SHELL= line
in CONFIG.SYS and rebooted.
Once you have the DOS settings correct, you can create a VDM
icon that gives you a standard 4DOS prompt by simply placing a
[*] in the Program Name field (on the Program page in the
icon's Settings notebook). This tells OS/2 to load the DOS
command processor and go to a prompt instead of running a
specific DOS application. Then go back to the Session page
and set the session type to DOS Full Screen or DOS Window.
The session type should be set after the Program Name field is
filled in.
You may, of course, customize any icon with optional 4DOS
command line switches, such as "@" followed by a custom INI
file name, or "//" followed by an INI file command (see page
108 of your 4DOS manual for more details). These switches can
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 41
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
be placed at the end of the DOS_SHELL setting, or in the
Parameters field in the Program window.
For example, your Program page might have the following
settings for a standard 4DOS prompt, using a special INI file
for this session:
Program Name: *
Parameters: @D:\4DOS\OS2VDM.INI
Working Directory: C:\
You can run any internal command, DOS application, batch file,
or alias directly from a 4DOS VDM icon. To do so, place the
command to be executed as the last item in the Parameters
field for the icon. 4DOS will execute the command and then
display a prompt. 4DOS will execute the command after it
processes your 4START file (if any) and AUTOEXEC.BAT.
If you precede the command name with /C, 4DOS will exit and
return to the OS/2 desktop when the command is finished. This
is a "temporary" VDM, described in more detail on page 44.
You can also make 4DOS exit when the command is complete by
invoking a batch file or alias which ends with the EXIT
command.
You can also run a DOS program by placing its name in the
icon's Program Name field. When you select the icon, OS/2
will automatically run a temporary VDM to load 4DOS, execute
the command, and then return to the OS/2 desktop. To use this
capability, you must include the full path name for the
program. For example:
Program Name: E:\WORDPROC\WP.EXE
Parameters: [blank]
Working Directory: D:\LETTERS
4DOS.INI for OS/2 Version 2.0 DOS Sessions
Each time you start a DOS session, 4DOS will search for
4DOS.INI in the directory where 4DOS.COM is stored, then in
the root directory of that drive, and finally in the root
directory of the boot drive.
In most cases, the best strategy is to put 4DOS.INI in the
same directory as 4DOS.COM and make sure your COMSPEC setting
is correct as described above. 4DOS will use this 4DOS.INI
file by default for all DOS sessions.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 42
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
To use a different INI file for sessions started from a
particular icon, include an @ininame parameter on the
DOS_SHELL setting for that icon. Be sure to include the full
path and name of the file. To modify specific 4DOS.INI
settings for sessions started from an icon, use one or more
//iniline parameters on the DOS_SHELL setting for the icon.
For icons with a [*] in the program name field, the @ininame
or //iniline parameters may be placed at the beginning of the
Parameters field if you wish, rather than in the DOS_SHELL
setting.
You can also use the @ininame parameter on your SHELL= line in
the OS/2 CONFIG.SYS file to change the default location of
4DOS.INI for all DOS sessions run under OS/2. If you do so,
remember that changes made in CONFIG.SYS will only affect
icons created after your next reboot, and will not affect
existing icons.
Startup Files for OS/2 Version 2.0 DOS Sessions
Each time you start a DOS session, 4DOS will search for 4START
and 4EXIT in the directory where 4DOS.COM is stored, then in
the root directory of the boot drive. It will search for
AUTOEXEC.BAT in the root directory of the OS/2 boot drive.
Therefore, the same 4START, 4EXIT, and AUTOEXEC.BAT files will
normally be used for all DOS sessions. You can override these
defaults with the 4StartPath and AutoExecPath directives in
4DOS.INI.
To select different 4START, 4EXIT, andAUTOEXEC.BAT files for a
particular icon, place the files for that icon in a directory
that is not one of the default directories described above.
Then create a new 4DOS.INI file for that icon, using
4StartPath and / or AutoExecPath directives to point to the
new directory, or use a //4StartPath or //AutoExecPath
directive in the DOS_SHELL setting or parameters field for the
icon.
To disable the default 4START, 4EXIT, or AUTOEXEC.BAT files
for a particular icon without selecting alternate files, use
the techniques described above to tell 4DOS to load these
files from a directory where they do not exist. All three
files are optional, so if they do not exist in the directory
specified by 4StartPath or AutoExecPath, they will not be
executed. If you wish, you can then execute an alternate
startup batch file for that icon by placing its name in the
Parameters field for the icon, as described on page 42.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 43
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
Remember that if your 4START and 4EXIT files have the
extension .BTM, they may be executed by both 4DOS and 4OS2
(see page 29). If so, you may need to customize them for DOS
mode and OS/2 mode. You can use the internal variable %_DOS
to separate commands for each operating system (see page 28
for a detailed example).
"Temporary" VDMs
So far, we have discussed starting a VDM to run 4DOS and get
to the DOS prompt. OS/2 version 2.0 also lets you start a
temporary VDM, for example to run a DOS application or batch
file from an icon. In a temporary VDM, 4DOS is still loaded
as the primary shell even though it is being invoked to run
just a single command or application. This primary 4DOS shell
is also a "transient" shell that exits (back to OS/2) when its
job is done. Temporary VDMs are created automatically by OS/2
if you set up an icon with the Program Name set to the name of
a DOS application. You can also start them yourself by using
a /C in the Parameters field for a standard 4DOS icon (see
page 42).
You usually won't want a temporary VDM to load all the memory-
resident utilities and execute all the other commands that you
want when you are setting up a DOS prompt. Most often, you
will want to set up a simple VDM, run the command, and exit as
quickly as possible. The 4DOS internal variable %_TRANSIENT
makes it easy to do just that. The beginning of your
AUTOEXEC.BAT file could look like this:
iff %_transient == 1 then
call setpath
call aliases
quit
endiff
This fragment calls other batch files to set up the path,
aliases, and the environment, but it does not load TSRs.
Configuring 4DOS for Dual Boot and Boot Manager
When you install OS/2, you are given a choice of making it the
only operating system on your computer, or retaining a DOS
boot capability as well.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 44
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
If you retain a DOS boot capability, OS/2 offers two different
methods for switching between DOS and OS/2: Dual Boot (OS/2
versions 1.x and 2.0) and Boot Manager (OS/2 version 2.0
only). The way you configure 4DOS to work with OS/2 depends
partly on whether you retain a DOS boot capability on your
computer, and, if so, which method you choose.
Dual Boot is invoked with the BOOT command (the program
BOOT.COM distributed with OS/2). If you use Dual Boot, you
will have one copy of CONFIG.SYS and AUTOEXEC.BAT available on
your boot drive when you boot in DOS mode and another version
available when you boot in OS/2 mode. BOOT.COM works by
swapping the DOS and OS/2 versions of CONFIG.SYS and
AUTOEXEC.BAT, as well as other hidden system data, then
rebooting the computer.
The Boot Manager (included with OS/2 version 2.0 only) uses a
different approach. It lets you install DOS on one hard drive
partition and OS/2 on another partition. When you boot the
computer, the Boot Manager displays a menu and lets you pick
which operating system to boot. Each partition will have its
own versions of CONFIG.SYS and AUTOEXEC.BAT.
The difference between these approaches is the location and
availability of files. If you use Dual Boot, all booting is
from the same drive. The CONFIG.SYS and AUTOEXEC.BAT files
are switched back and forth as you boot from one operating
system or the other; the set of files that is in use is
stored in the root directory of the boot drive, and the set
not in use at any given time is stored in the \OS2\SYSTEM
directory. If you use the Boot Manager, the files for DOS
reside on one drive (for example, C) and those for OS/2 are on
another drive (for example, D). The files are not moved when
you switch operating systems. In both cases, you can keep the
startup files synchronized or independent to meet your own
needs.
Setting up CONFIG.SYS under these conditions is very simple.
Modify your OS/2 CONFIG.SYS file for 4DOS and 4OS2 as
described in this manual, and modify your DOS CONFIG.SYS file
for 4DOS as described in the 4DOS manual. The two files
remain separate, and any changes to common items (for example
the name of the directory where 4DOS is stored, used in the
SHELL= command) must be made in both files.
With AUTOEXEC.BAT, you have more flexibility. Whether you use
Dual Boot or Boot Manager, you will have two standard
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 45
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
AUTOEXEC.BAT files: one for starting 4DOS under a DOS boot
and one for OS/2 DOS sessions.
If you want very different commands in AUTOEXEC.BAT for a DOS
boot and OS/2 DOS sessions, you can keep the two files
separate and distinct. Just make sure that both files are
updated whenever you make changes to the commands they have in
common. You can also CALL other batch files from each copy of
AUTOEXEC.BAT to handle common commands.
However, you may find that many of the commands in the two
AUTOEXEC.BAT files are the same and that it is more convenient
to maintain a single file.
If you use the Boot Manager, you can put all of your
instructions in one file and start it from the other. For
example, if DOS boots from drive C: and OS/2 boots from drive
D:, your AUTOEXEC.BAT on drive D: could simply be:
cdd c:\
autoexec.bat
On a Dual Boot system, you could accomplish the same thing by
putting all of your commands into a third file (for example,
C:\SYSTART.BAT) and CALLing it from both the DOS and OS/2
AUTOEXEC.BAT files.
You can also use the AutoExecPath directive in 4DOS.INI to
force 4DOS to look in a particular directory for AUTOEXEC.BAT
regardless of whether it is started from an OS/2 DOS session
or from a DOS boot, and regardless of the boot drive.
If you keep commands for both boot modes in a single
AUTOEXEC.BAT file, you can use the internal variable %_DOSVER
to separate commands to be executed during a DOS boot from
those for an OS/2 DOS session (see page 28 for a detailed
example).
Handling 4DOS's startup and exit files (4DOS.INI, 4START, and
4EXIT) is a little different. Unlike CONFIG.SYS and
AUTOEXEC.BAT, the 4DOS files won't be swapped for you when you
switch operating systems with Dual Boot, and they won't be
automatically stored on separate partitions if you use the
Boot Manager. 4DOS normally looks for these files in the
directory where 4DOS.COM is stored, so the same files will be
used for both a DOS boot and OS/2 DOS sessions. If you want
separate files for these different situations, you must use
4DOS features to set them up.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 46
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
To set up separate 4DOS.INI files for a DOS boot and OS/2 DOS
sessions, use the @ininame parameter on the SHELL= line in
your OS/2 CONFIG.SYS file to change the location of 4DOS.INI
for DOS sessions run under OS/2. You can do the same for a
DOS boot by making a similar change to your DOS CONFIG.SYS
file.
To select different 4START and 4EXIT files for a DOS boot and
for OS/2 DOS sessions, place the files for one type of boot in
a different directory (not the directory where 4DOS.COM is
stored). Then either set up a different 4DOS.INI file for
that boot mode as described above, using 4StartPath to point
to the new directory, or use a //4StartPath directive on the
SHELL= line in CONFIG.SYS for that boot mode.
You can also keep commands for both boot modes in a single
file, and use %_DOSVER to separate the commands to be executed
during a DOS boot from those for an OS/2 DOS session.
Remember that if your 4START and 4EXIT files have the
extension .BTM, they may be executed not only in different
boot modes, but also by both 4DOS and 4OS2 (see page 29). If
so, you may need to customize them for DOS mode and OS/2 mode.
You can use the internal variable %_DOS to separate commands
for each operating system (see page 28 for a detailed
example).
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 47
CHAPTER 5 / COMMAND REFERENCE GUIDE
___________________________________________________________________
CHAPTER 5 / COMMAND REFERENCE GUIDE
This chapter provides information about commands that are new in
4OS2, and commands which differ from 4DOS. For a complete
reference to 4DOS and 4OS2 commands see Chapter 8 (page 157) in the
4DOS Reference Manual.
The following commands are unique to 4OS2:
DETACH starts an OS/2 program in detached mode.
DPATH sets the search path for data files.
KEYS enables, disables, or displays the history list.
START starts a program in a new session.
The following commands have different options in 4OS2 than they do
in 4DOS:
DIR can display directories in either the high performance
file system (HPFS) or traditional DOS-compatible FAT format.
ESET, SET, and UNSET do not have a /M(aster environment)
option in 4OS2.
HELP can display explanations of OS/2 system error messages
and can automatically change the 4OS2 prompt.
SETDOS does not have the ANSI and Line Input options that are
available in 4DOS.
The new commands and the changes to DIR, HELP, and SETDOS are
described in detail on the following pages.
The following 4DOS commands are not available in 4OS2, because they
perform functions that are not meaningful and/or feasible under
OS/2:
BREAK LOADHIGH / LH
CTTY SWAPPING
KEYSTACK TRUENAME
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 48
CHAPTER 5 / COMMAND REFERENCE GUIDE / DETACH
___________________________________________________________________
DETACH (Compatible)
Purpose: Start an OS/2 program in detached mode.
Format: DETACH command
command: the name of a command to execute, including
an optional drive and path specification. The name
must be enclosed in quotation marks if it contains a
space.
See also: START
Usage: When you start a program with DETACH, that program
cannot use the keyboard, mouse, or video display. It
is "detached" from the normal means of user input and
output. However, you can redirect the program's
standard I/O to other devices if necessary, using the
4OS2 redirection symbols.
The command can be an internal command, external
command, alias, or batch file. If you specify an
internal command, alias, or batch file (either a .CMD
or .BTM file) as the command, 4OS2 will detach a copy
of itself to execute the command.
For example, the following command will detach a copy
of 4OS2 to run the batch file XYZ.BTM:
[c:\] detach xyz.btm
Once the program has started, 4OS2 returns to the
prompt immediately. It does not wait for a detached
program to finish.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 49
CHAPTER 5 / COMMAND REFERENCE GUIDE / DIR
___________________________________________________________________
DIR (Enhanced)
[see page 198 of the 4DOS Reference Manual]
Purpose: Display information about files and subdirectories.
Format: DIR [/1 /2 /4 /A[[:][-]rhsda] /B /C /F /J /K /L /M /N
/O[[:][-]deginsu] /P /S /T /U /V /W /Z] [file...]
file: The file, directory, or list of files or
directories to display.
/1 (one column) /M (suppress footer)
/2 (two columns) /N (use HPFS format)
/4 (four columns) /O (sort order )
/A(ttribute select) /P(ause)
/B(are) /S(ubdirectories)
/C(ase -- use upper case) /T (aTtribute display)
/F(ull path) /U (sUmmary information)
/J(ustify names) /V(ertical)
/K (suppress header) /W(ide)
/L(ower case) /Z (use FAT format)
Usage: The DIR command is the same in 4OS2 and 4DOS, except
that the /N option has a new meaning and the /Z option
has been added. The 4DOS /N option, which resets DIR
to default values, has no equivalent in 4OS2.
Options: /N: Display the directory in OS/2 high performance
file system (HPFS) format.
/Z: Display the directory in DOS-compatible FAT
format. Long names on an HPFS drive will be truncated
to 11 characters. The name will be followed by a
solid right arrow symbol [a] to show that one or more
characters have been truncated.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 50
CHAPTER 5 / COMMAND REFERENCE GUIDE / DPATH
___________________________________________________________________
DPATH (Compatible)
Purpose: Specify the subdirectories which applications will
search to find files that are not in the current
directory.
Format: DPATH [directory[;directory...]]
directory: The full name of a directory to include in
the DPATH (data path) setting.
See also: PATH, SET, and ESET in the 4DOS Reference
Manual.
Usage: When most OS/2 applications try to open a data file,
they look for the file in the current directory first.
If they fail to find the file there, they search each
of the directories in the DPATH setting in the order
that they are included. 4OS2 internal commands like
TYPE do not search the DPATH directories for files.
For example, the following DPATH command directs
applications to look for files in the following order:
the current directory, the INIT directory on C, and
the CONFIG directory on D:
[c:\] dpath c:\init;d:\config
The listing of directories to be searched can be set
or viewed with the DPATH command. The list is stored
as an environment string with the variable name DPATH,
and can also be set or viewed with the SET command and
edited with the ESET command.
Directory names in the DPATH must be separated with
semicolons [;]. 4OS2 will not shift directory names
in the DPATH to upper case as it does with those in
the PATH setting. If you want the names in the DPATH
to be in upper case you must enter them that way.
If you enter DPATH with no parameters, 4OS2 displays
the current DPATH search list.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 51
CHAPTER 5 / COMMAND REFERENCE GUIDE / HELP
___________________________________________________________________
HELP (Enhanced)
Purpose Display help for 4OS2 commands and OS/2 system
messages.
Format: HELP [topic] [ON | OFF]
topic: A help topic, 4OS2 internal command, or OS/2
error number.
Usage: HELP works the same in 4OS2 as in 4DOS but has some
additional features.
When you start HELP, the text you see depends on the
help "books" that 4OS2 opens. The list of books is
determined by the HelpBook directive in 4OS2.INI (see
pages 35 and 36 for more information). The topic may
be from any book in the HelpBook list.
If you type either of these commands:
[c:\] help nnnn
[c:\] help sysnnnn
where "nnnn" is an OS/2 system error number, HELP will
display an explanation of the OS/2 error. This
feature works by running the OS/2 program HELPMSG.EXE
which opens the file OSO001.H to get the explanation.
For this feature to work, HELPMSG.EXE must be in a
directory that is in your PATH setting and the data
file OSO001H.MSG must be in a directory in your DPATH.
If you type
[c:\] help on
4OS2 will change the default prompt to $i[$p]. If you
type
[c:\] help off
then 4OS2 will change the default prompt to [$p].
This feature is included for compatibility with OS/2's
CMD.EXE. Changing the prompt is probably better
accomplished by using the PROMPT command instead of
HELP ON or HELP OFF.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 52
CHAPTER 5 / COMMAND REFERENCE GUIDE / KEYS
___________________________________________________________________
KEYS (Compatible)
Purpose: Enable, disable, or display the history list.
Format: KEYS [ON | OFF | LIST]
See also: HISTORY in the 4DOS Reference Manual.
Usage: This command emulates the CMD.EXE KEYS command, which
controls the history list. It is provided for
compatibility with CMD.EXE. The same functions are
available by setting the HistMin directive in 4OS2.INI
and by using the HISTORY command in 4OS2.
The history list collects the commands you type for
later recall, editing, and viewing. You can view the
contents of the list through the history list window
(see page 59 in the 4DOS Reference Manual) or by
typing any of the following commands:
[c:\] history
[c:\] history /p
[c:\] keys list
The first command displays the entire history list.
The second displays the entire list and pauses at the
end of each full screen. The third command produces
the same output as the first, except that each line is
numbered.
You can disable the collection and storage of commands
in the history list by typing
[c:\] keys off
Once the history has been turned off, you can turn it
back on by typing
[c:\] keys on
If you issue the KEYS command without any parameters,
4OS2 will show you the current status of the history
list.
See page 21 for more information about how the history
list is stored.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 53
CHAPTER 5 / COMMAND REFERENCE GUIDE / SETDOS
___________________________________________________________________
SETDOS (New)
[see page 280 of the 4DOS Reference Manual]
Purpose: Display or set the 4OS2 configuration.
Format: SETDOS [/C? /E? /I+|- command /M? /N? /P? /R? /S?:?
/U? /V?]
/C(ompound) /P(arameter character)
/E(scape character) /R(ows)
/I(nternal commands) /S(hape of cursor)
/M(ode for editing) /U(pper case)
/N(o clobber) /V(erbose)
Usage: The SETDOS command is the same in 4OS2 as it is in
4DOS, except that two of the optional parameters are
not available in 4OS2 and their values are not
reported.
The /A(NSI) option and the ANSI directive in 4OS2.INI
are not available because 4OS2 enables ANSI support
and assumes that it remains enabled. You can turn off
ANSI support with OS/2's external ANSI command
(ANSI.EXE). If you do, however, 4OS2 will not notice
the change and will display unusual characters or
ignore colors in your CLS and COLOR commands. The
4OS2 internal variable %_ANSI reflects the state of
OS/2 established with ANSI.EXE.
The /L(ine) option and the LineInput directive in
4OS2.INI are not available because the "line input"
capability is not required for compatibility with OS/2
applications, as it may be under DOS.
In all other respects, the commands are the same. See
the 4DOS Reference Manual for a full description of
SETDOS.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 54
CHAPTER 5 / COMMAND REFERENCE GUIDE / START
___________________________________________________________________
START (Enhanced)
Purpose: Start a program in another session.
Format: START ["program title"] [/B[G] /DOS /C /F[G] /FS /I
/ICON=filename /INV /K /L /LA /LH /MAX /MIN /N
/PGM progname /PM /POS=row,col,width,height /WIN
/WAIT] [command]
program title: Title to appear on title bar.
filename: Name of icon (.ICO) file.
progname: Program name (not the session name).
command: Command to be executed.
/B[G] (background) /LA (local aliases)
/DOS (DOS session) /LH (local history list
/C(lose when done) /MAX(imized)
/F[G] (foreground) /MIN(imized)
/FS (full screen) /N(o command processor)
/I(nherit environment) /PGM (program name)
/ICON (name .ICO file) /PM (PM application)
/INV(isible) /POS(ition of window)
/K(eep when done) /WAIT for completion
/L(ocal lists) /WIN(dowed session)
See also: DETACH in this manual.
Usage: START is used to begin a new session and, optionally,
to run a program in that session. If you use START
with no parameters, it will begin a new 4OS2 session.
If you add a command, START will begin a new session
and execute the command that you have specified.
START determines the application type automatically
and starts the session in the appropriate mode (OS/2
or DOS; full-screen, windowed, or Presentation
Manager).
If the program is a DOS application or .BAT file, 4OS2
will return an error message in OS/2 version 1.x. In
OS/2 version 2.0, 4OS2 will start a new DOS session to
run the program or batch file. The DOS session will
close itself automatically as soon as the program or
batch file ends. If you want the session to wait for
a keystroke before it closes itself, you can use the
syntax:
[c:\] start /DOS progname ^^ pause
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 55
CHAPTER 5 / COMMAND REFERENCE GUIDE / START
___________________________________________________________________
(Because the caret [^] is the 4OS2 escape character,
two carets must be used in order to pass one on to
4DOS as a command separator.)
If you want to start a DOS command-line session in
OS/2 version 2.0, you can use the command:
[c:\] start /DOS
DOS sessions created with START use the default DOS
settings in CONFIG.SYS. You cannot change the DOS
settings for these sessions individually the way you
can for sessions started from an icon.
START gives you some flexibility in determining the
session mode. For example, if the command is the name
of a batch file (either a .BTM or .CMD file), you can
use the /FS or /WIN options to run the batch file as
part of a new 4OS2 session in either full-screen or
windowed mode.
However, you cannot start a session in a mode that is
inappropriate for the application type. A DOS
application can not be run as part of a Presentation
Manager session, for example, even if you use the /PM
switch. Invalid or conflicting options will be
ignored. 4OS2 will always attempt to run the command
in the appropriate type of session.
The list below summarizes the most commonly used START
options, and how you can use them to control the way a
session is started:
/BG and /FG allow you to start the session in the
background (does not respond to keystrokes until
selected) or foreground (responds to keystrokes
until deselected). /FG is the default if /DOS,
/FS, /WIN, or /PM is used, otherwise /BG is the
default.
/FS and /WIN control whether a character-mode
session is started in full-screen or windowed
mode. The default is to start a session of the
same type as the current 4OS2 session, if the
application can be run in such a session.
/MAX, /MIN, and /POS allow you to start a
character-mode windowed session in a maximized
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 56
CHAPTER 5 / COMMAND REFERENCE GUIDE / START
___________________________________________________________________
window, a minimized window, or a window with a
specified position and size. The default is to
allow OS/2 to choose the position and size of the
window.
/C and /K allow you to close the session when the
command is finished (the default for DOS and PM
sessions) or keep it open and go to a prompt (the
default for OS/2 character mode sessions).
The program title, if it is included, will appear on
the title bar and the Presentation Manager task list
(OS/2 version 1.x) or window list (OS/2 version 2.0).
The program title must be enclosed in quotation marks
and cannot exceed 60 characters in length. If the
program title is omitted, the program name will be
used as the session title and on the task list.
Options: /BG (BackGround session): The session is started as a
background session. /BG may be abbreviated to /B.
/C(lose): The session is started using 4OS2.EXE and
is closed when the application ends.
/DOS (DOS session): Start a DOS session in a Virtual
DOS Machine (OS/2 version 2.0). This option is not
available in OS/2 version 1.x, which doesn't allow
multiple DOS sessions.
/FG (ForeGround session): Start the session as the
foreground session. /FG may be abbreviated to /F.
/FS (Full Screen): Start the session as a full-screen
session.
/I(nherit environment): Inherit the default
environment specified in CONFIG.SYS rather than the
current 4OS2.EXE environment.
/ICON=filename: Use the specified icon file. If you
don't use /ICON, 4OS2 will look for an .ICO file with
the same file name and in the same directory as the
program file.
/INV(isible): Start the session as invisible. No
icon will appear and the session will only be
accessible through the Task Manager or Window List.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 57
CHAPTER 5 / COMMAND REFERENCE GUIDE / START
___________________________________________________________________
/K(eep session at end): The session is run using
4OS2.EXE, and continues after the application program
ends. Use the EXIT command to end the session.
/L(ocal lists): Start 4OS2.EXE with local alias and
history lists. This option combines the effects of
/LA and /LH.
/LA (Local Alias list): Start 4OS2.EXE with a local
alias list. If you don't use this option, the session
will share the alias list of the current 4OS2 shell,
unless a LocalAliases=No directive is used in 4OS2.INI
or on the command line.
/LH (Local History list): Start 4OS2.EXE with a local
history list. If you don't use this option, the
session will share the history list of the current
4OS2 shell, unless a LocalHistory=No directive is used
in 4OS2.INI or on the command line.
/MAX(imized): Start the session maximized.
/MIN(imized): Start the session minimized.
/N(o command processor): Run an OS/2 application
directly, without loading another copy of 4OS2. This
is the default for Presentation Manager applications.
You cannot use /N when the command is a batch file or
internal command.
/PGM (ProGraM name): The string following this option
is the program name. The first quoted string on the
line will be used as the session and task list title
only, and not as the program name.
/PM (Presentation Manager): Start a PM session.
/POS(ition): Start the window at the specified screen
position. The full syntax is /POS=row, col, width,
height where the values are specified in pels. Row
and col are the bottom left corner of the window (the
bottom left corner of the screen is position 0,0).
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 58
CHAPTER 5 / COMMAND REFERENCE GUIDE / START
___________________________________________________________________
/WAIT: Wait for the session to finish before
returning to the prompt. This is similar to running a
program directly from the prompt (without START), but
allows you to use options like /MAX or /POS, which are
not available when a program is run directly.
/WIN(dowed): Start the session in a window.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 59