OS/2 Commands
The Commands are listed here alphabetically, you may browse through
them or you may click on the links below.
- ANSI
-
Allows or prevents extended display and keyboard support in the OS/2
environment.
---|---------|-----|--------|---- ANSI ------|-------|----|
|- drive -| |- path -| |- ON -|
|- OFF -|
Related Commands: DEVICE=;)ANSI.SYS and ;)KEYS
If you enter this command without a parameter, ANSI displays its current
status.
This command allows or prevents ANSI control sequence processing in OS/2
sessions. You use ANSI control sequences to redefine keys, manipulate the
cursor, and change display color attributes.
When KEYS is ON, ANSI extended keyboard support is disabled.
- APPEND
-
Sets a search path for data files that are outside the current
directory.
---|---------|-|--------|--- APPEND ------|------|---------
|- drive -| |- path -| |- /E -|
. . . . . .--|---------|-|--------|-------|-------------|------------|
|- drive -| |- path -| |- /PATH:ON -|
|- /PATH:OFF -|
Related Commands: ;)DPATH ;)PATH ;)SET
Enter APPEND without a parameter to display the APPEND statement in your
AUTOEXEC.BAT file. This statement can be set by system installation.
Enter APPEND ; to cancel the APPEND command.
The first time you use APPEND, it is an external command, and you might need
to specify a drive and path to locate it. Once APPEND is loaded, it becomes
an internal command, and a drive and path are no longer needed.
APPEND is useful when you want to keep an application program and its
associated data files in one directory and group information by category in
other directories. If you specify a path with APPEND the first time you use
it, this path is not stored in the environment, and you can only view or
change it with the APPEND command. You can append as many directories as you
can specify in a total of 128 characters.
The search sequence for a specified file is:
1. Search the specified directory, or the current directory
if you do not specify the directory.
2. Search the directories indicated by the current APPEND
command.
APPEND is similar to the PATH command, although the PATH command finds only
startable files. You can look at or modify APPEND paths in the environment by
using APPEND, or you can use the SET command.
; Cancels an APPEND command.
/E To keep paths specified with APPEND in the DOS
environment.
- ASSIGN
-
Assigns a drive letter to a different drive. ASSIGN allows you
to perform disk operations on drives other than A and B for
programs that use only those two drives.
---|---------|-|--------|---- ASSIGN --------|---------|-|-|
|- drive -| |- path -| |- x = y -| |
| |
|--------------|
Related Commands: ;)JOIN ;)SUBST
Enter this command without a parameter to reset all drives to their original
assignments.
Family API programs cannot be loaded from cross-assigned drives.
ASSIGN hides the true device type from commands that require actual drive
information. The following commands do not work in DOS sessions on drives
that have ASSIGN in effect:
CHKDSK DISKCOMP DISKCOPY FORMAT
JOIN LABEL PRINT RECOVER
RESTORE SUBST
X=Y
X Specifies the drive to which reads and writes are
currently sent. Do not type a colon after the drive
letter.
Y Specifies the drive to which you want reads and writes
sent. Do not type a colon after the drive letter.
- ATTRIB
-
Displays the current file state. It also turns on or off the
read-only attribute and the archive bit of a file for selected
files in a directory, or for all files in a directory level.
|-------------------|
|
---|---------|-|--------|-- ATTRIB ------|--------------|-|-
|- drive -| |- path -| |---|- +R -|---|
| |- -R -| |
|---|- +S -|---|
| |- -S -| |
|---|- +H -|---|
| |- -H -| |
|--|-- +A --|--|
|-- -A --|
. . . . . --|---------|-|--------|----- filename ------|------|----|
|- drive -| |- path -| |- /S -|
Related Commands: ;)BACKUP ;)RESTORE ;)XCOPY
Enter this command along with the name of a file to display the current file
state. This command is useful in keeping files from being modified. When you
turn on the read-only attribute of a file, you can read it, but you cannot
write to it or change it.
You can specify the optional +R, -R, +A, -A, +S, -S, +H, or -H parameters
either before or after the file name. Be sure to use only one read-only
attribute and one archive attribute per command.
If a file exists in more than one directory, you can use the /S parameter to
find all occurrences of that file.
Return Codes: ATTRIB issues a return code of 0 for normal completion.
+R Turns on the read-only attribute of a file.
-R Turns off the read-only attribute of a file.
+A Turns on the archive bit of a file.
-A Turns off the archive bit of a file.
/S Processes all subdirectories
- BACKUP
-
Backs up (copies) one or more files from one disk to another.
---|---------|-|--------|----------- BACKUP ---------------
|- drive -| |- path -|
. . . . . . --------------------|-- source drive --|------------------
|---- path ------|
|---- filename ----|
|-----------------------------------|
target |
. . . . . .----- drive -------|------------------------|-------|---|
|----- /L:filename ------|
|----- /D:mm-dd-yy ------|
|----- /T:hh:mm:ss ------|
|--------- /M -----------|
|--------- /A -----------|
|------- /F:xxx ---------|
|--------- /S -----------|
Related Commands: ;)ATTRIB ;)RESTORE ;)XCOPY
Note:
o After BACKUP fills a diskette, BACKUP prompts you to insert a new diskette.
Label each diskette in consecutive order, recording the date and diskette
number. When you restore the files, RESTORE prompts you to insert the backup
diskettes in order.
o BACKUP works only within the source directory unless you specify the /S
parameter, which copies files in the source directory and in all directories
below the starting source directory.
o BACKUP can back up files on disks of different types.
o If the source is a diskette, it should not be write- protected because
BACKUP needs to reset the archive bit on the backed-up files.
o BACKUP does not back up the system files (COMMAND.COM and CMD.EXE), hidden
system files, and any open dynamic link library files (.DLL). BACKUP also
does not back up any files opened with Deny Read/Write. BACKUP issues a
system message if you try to back up one of these files.
o If you are sharing files, you can back up only those files that you have
access to. If you attempt to access a file that you do not have access to,
BACKUP displays a message stating that it was not able to back up the file.
o Files that you back up do not appear in the root directory on the target
diskette. BACKUP creates two files, called BACKUP.XXX and CONTROL.XXX, in the
root directory on the target diskette. The BACKUP.XXX file contains all the
files that have been backed up, and the CONTROL.XXX file saves paths, file
names, and other controlling information.
Extended Attributes: The BACKUP command saves the extended attributes
associated with a file or directory. An extended attribute is a special area
used for storing data that describes the file or directory to the operating
system or to an application. When backing up files or directories that have
extended attributes, be sure to use OS/2 Version 1.2 (or later) to ensure all
extended file attributes are backed up.
Return Codes:
0 - Normal completion.
1 - No files were found to back up.
2 - Some files or directories were not processed because of file errors.
3 - Ended by user.
4 - Ended because of error.
5 - Not defined.
6 - BACKUP was unable to process the FORMAT command.
Parameters:
/L:filename Makes a backup log entry in the file
specified.
/D:mm-dd-yy Backs up only those files that were last
modified on or after the specified date. This
parameter expects the date to be entered in
the correct format for the current country
specified with the COUNTRY command.
/T:hh:mm:ss Backs up only those files that were last
modified at or after a certain time. It is
recommended that /T be used with /D.
/M Backs up only those files that have changed since
the last backup.
/A Adds the files to be backed up to those already on
the backup disk.
/F Specifies that unformatted target diskettes are
formatted before BACKUP starts.
/S Backs up subdirectories.
- BOOT
-
Switches between the DOS and OS/2* operating systems that are
on the same hard disk (drive C).
---|---------|-----|--------|---- BOOT ------|- /OS2 -|----|
|- drive -| |- path -| |- /DOS -|
The BOOT command can be run from an OS/2 command prompt or a DOS command
prompt as well as from DOS.
BOOT is available under the following conditions:
o DOS Version 3.2 (or a later version) was installed and operating on drive C
before the OS/2 operating system was installed. (It is recommended that you
use DOS 3.3, DOS 4.0, or DOS 5.0 for greater compatibility with OS/2 2.0.)
o Drive C was not formatted during OS/2 installation.
o The High Performance File System was not installed on drive C.
Before typing the BOOT command, make sure all system operations are complete
and all programs are stopped.
BOOT verifies that the following files exist:
OS/2 files
OS2LDR (hidden file)
OS2KRNL (hidden file)
OS2\SYSTEM\BOOT.OS2
OS2\SYSTEM\CONFIG.OS2
DOS files
IBMBIO.COM or MSDOS.SYS (hidden file)
IBMDOS.COM or IO.SYS (hidden file)
OS2\SYSTEM\BOOT.DOS
OS2\SYSTEM\CONFIG.DOS
When you use the BOOT command to start DOS from the OS/2 operating system,
BOOT renames and stores system startup information as follows:
1. Saves the OS/2 boot record as C:\OS2\SYSTEM\BOOT.OS2
2. Moves the OS/2 AUTOEXEC.BAT file to
C:\OS2\SYSTEM\AUTOEXEC.OS2.
3. Moves the OS/2 CONFIG.SYS file to C:\OS2\SYSTEM\CONFIG.OS2.
4. Copies C:\OS2\SYSTEM\BOOT.DOS to the DOS boot record.
5. Moves the DOS AUTOEXEC.BAT file from
C:\OS2\SYSTEM\AUTOEXEC.DOS to the root directory as BOOT moves
the OS/2 AUTOEXEC.BAT file.
6. Moves the DOS CONFIG.SYS file from C:\OS2\SYSTEM\CONFIG.DOS
to the root directory as BOOT moves the OS/2 CONFIG.SYS file.
BOOT reverses the process when you want to start the OS/2 operating system.
Return Codes: BOOT displays either a return code of 0 for
normal completion or the appropriate error message.
- BREAK
-
Instructs DOS to check whether the Ctrl and Break keys have
been pressed before carrying out a program request.
BREAK ------------|---------|------------------------------|
|-- ON --|
|-- OFF --|
Enter the BREAK command at the DOS command prompt to display the current
status.
BREAK instructs the system to check if you pressed the Ctrl and Break keys
together before the system carries out a program request. Pressing and
holding the Ctrl and Break keys together stops a command from completing its
task.
BREAK can be entered in the CONFIG.SYS file, in a batch file, or at the
command prompt. If BREAK is ON, processing might be slower, but the operating
system will probably intercept Ctrl+Break faster. Setting BREAK=ON allows you
to leave a program even if it produces few or no standard device operations
(such as a compiler). For example, if a program is being compiled and it
meets an error or loop, it is important to have a way to stop compilation.
If you accept the system installation default for the BREAK statement, the
installation program places the following in your CONFIG.SYS file:
BREAK=OFF
- CACHE
-
Specifies the parameters that the High Performance File System
(HPFS) uses to write information to a disk. This command is
specified as part of a RUN statement in the CONFIG.SYS file or
entered at a command prompt.
CACHE ---|---------------|----|----------------|---------
|- /LAZY:state -| |- /MAXAGE:time -|
. . . . . .-------|------------------|----|--------------------|-----|
|- /DISKIDLE:time -| |- /BUFFERIDLE:time -|
Related Commands: ;)IFS IFS ( ;)HPFS.IFS )
If you enter this command without a parameter, the operating system displays
the current values for CACHE.
You can use cache memory if you have:
o Formatted the hard-disk partition during OS/2
installation
o Selected the High Performance File System
The system installation program sets up caching for the primary partition
through the OS2.INI file. The HPFS manages a cache of memory divided into
blocks of 2KB. Data that is read from and written to the disk is transferred
through this cache so that it can be used in satisfying future requests. This
cache is separate from that of the BUFFERS and DISKCACHE commands discussed
elsewhere in this reference.
When a user requests data that is not present in the cache, the HPFS selects
the least recently used (LRU) block, writes the data within that block to disk
if necessary, and then fills the block with the requested data. This
significantly increases the chances that often-used data will be found in
memory, thus saving the expense of a disk-read operation.
In addition, the file system takes advantage of its knowledge of cache block
contents. Data, not expected to be reused soon by the file system, is placed
in cache blocks marked for immediate reuse. In most cases, when a write
request is received, it is not necessary to write the data immediately to
disk. The HPFS takes such data and copies it to the block cache without
actually performing the disk-write operation. Once the data is in the cache,
it is written to disk as a background activity.
Also, because these lazy-writes are performed during disk idle time, incoming
requests need not wait for large disk- write operations to be completed. This
optimizes overall system throughput and response time for all requesting
processes.
The HPFS also contains additional levels of caching that speed up access to
directories. The HPFS uses this cache to quickly get to the directory on
which the request is being made.
Note: If you set the /LAZY parameter to ON, select Shut down from the
menu of the desktop before turning off your system. Failure to do so will
cause loss of data if the contents of the HPFS cache buffers have not been
erased and written to disk. For safety, and if performance is not a concern,
use the /LAZY:OFF option, which causes a write through the cache to the disk.
- CHCP
-
Allows you to alternate between two code-page character sets
that are defined in your CONFIG.SYS file.
CHCP --------------------|-------|-------------------------|
|- nnn -|
Related Commands: ;)CODEPAGE ;)COUNTRY ;)DEVINFO ;)SPOOL
Type this command without a parameter to display the current code page being
used or to determine if any are specified.
Because CHCP changes the code page for the current session, it is intended to
be used at the command prompt. Any programs started under the primary command
processor inherit the command processor's current code page.
In the OS/2 environment, CHCP checks that the correct DEVINFO= statement is
included in the CONFIG.SYS file for the code page being requested. If not, a
message is displayed.
CHCP accepts either one of the two prepared system code pages as correct. If
you enter the number of a code page that has not been prepared for the system,
you receive an error message. If no CODEPAGE= statement is included in the
CONFIG.SYS file, CHCP returns the default code page ID of the country.
In the OS/2 environment, CHCP checks to see if a DEVINFO= statement is
included in the CONFIG.SYS file for LPT1, LPT2, or LPT3. If there is a
DEVINFO= statement, the printer for that device is queried to see if it
supports the code page being set. If it does not support that code page, an
informational warning message is displayed.
Incorrect, partial, or mismatched setup of statements for code-page
selections, country code, keyboard layout, display, or printer can cause
ineffective switching between code pages. If your printer is correctly set up
for code-page switching, print jobs started in a DOS session or in the current
OS/2 session, after a successful CHCP command is issued, will print in the new
code page.
Note: To ensure you will be able to access files prepared with another
code page, be sure to use only the characters A-Z and 0-9 when naming files
and directories. This prevents file access problems when switching between
code pages that have different character capitalization rules.
nnn Indicates the code page number you want to use.
- CHDIR OR CD
-
Changes the current directory or displays its name.
CHDIR ----|---------|---------|-------|--------|----------|
CD --| |- drive -| |- path -|
Related Commands: ;)DIR ;)MD ;)RD ;)TREE
Type this command without a parameter to display the name of the current
directory. For example, typing CD displays the current directory on the
default drive. Type this command with a drive letter to display the current
directory for that drive. For example, typing CD C: displays the current
directory on drive C.
CD or CHDIR can change the current directory, allowing you to access any
subdirectory you have created with the MD command. If the directory you want
to change to has a different path from your current directory, you must enter
its entire path, including the root directory. If you do not know the path of
the directory you want to change to, use the DIR or TREE commands.
- CHKDSK
-
Analyzes directories and files, determines the file system
type, and produces a disk status report. CHKDSK also displays
the volume label and the volume serial number of the disk.
---|---------|-|--------|---- CHKDSK -----|---------|-----
|- drive -| |- path -| |- drive -|
|-----------| |------------|
| |
. . . . .--|--------|-|------------|-----|------|-|----|--------|-|--|
|- path -| |- filename -| |- /F -| |- /C ---|
|- /V -| |- /F:n -|
The /C and /F:n parameters shown at the end of the CHKDSK command syntax are
only used with the High Performance File System.
Related Commands: ;)RECOVER
o Type this command at a DOS command prompt to produce a memory storage
report.
o CHKDSK gives accurate information only when a hard disk is not in use.
o CHKDSK does not work in DOS sessions on drives that have an ASSIGN, JOIN, or
SUBST command in effect. Also, CHKDSK does not work on network drives.
You should run CHKDSK occasionally on each disk to check for errors. If
errors are found, CHKDSK displays the error messages and produces a status
report. If you enter a file name after CHKDSK, the OS/2 operating system
displays a status report that gives the number of noncontiguous areas occupied
by the file. CHKDSK also produces a storage report.
CHKDSK can detect lost clusters on your disk. These are parts of files that
the system did not save completely and that take up space on your disk. If
CHKDSK finds these, it prompts you with a message asking if you want to
convert lost chains to files. If you type a Y (yes), CHKDSK converts these
parts into files that you can examine and delete to save space on your disk.
If you type an N (no), CHKDSK deletes these parts of files from your disk
without warning. The files CHKDSK creates from lost chains follow this naming
convention: FILEnnnn.CHK (nnnn is a sequential number starting with 0000).
To search for and recover lost file clusters on the drive that is the hard
disk from which you normally start the OS/2 operating system, follow these
steps:
1. Insert the system installation diskette in diskette drive A.
2. Restart the system. When the Logo panel appears, remove the
installation diskette and insert diskette 1. Press Enter to continue.
3. At the first text panel that appears (Welcome to OS/2), press Esc.
4. If the drive to be searched is a drive formatted for HPFS, the file
UHPFS.DLL has to exist on the same diskette as CHKDSK, or UHPFS.DLL
has to exist in a directory in the LIBPATH statement. To display the
LIBPATH statement, enter TYPE \CONFIG.SYS in the drive of the disk
that the system started from.
5. In order for the system to display error messages, the file
OSO001.MSG has to be on the same disk as CHKDSK or it has to
exist in a directory in your DPATH statement. To display your
DPATH statement, enter DPATH at the command line.
6. Run CHKDSK in drive A, specifying C as the drive to be searched.
To recover lost clusters on the drive that contains CHKDSK, copy CHKDSK to
another drive and run it from that drive by specifying the drive and path.
If the /F parameter is not specified and there are open files, CHKDSK may
report lost clusters on the disk. This happens when open files have been
written to but the file allocation table (FAT) is not updated. If many
clusters are reported as lost, use the /F parameter to search the disk.
Extended Attributes: CHKDSK will attempt to validate the clusters with
files or directories that contain extended attributes. An extended attribute
is a special area used for storing data that describes the file or directory
to the operating system or to an application. If errors occur in any extended
attribute chain on the disk, CHKDSK prompts you to recover that chain into a
file that follows this naming format: EAnnnn.CHK (nnnn is a sequential number
starting with 0000). CHKDSK also recovers the file or directory associated
with the extended attribute chain and places it in a file that follows this
naming format: FILEnnnn.CHK. The number in this file name corresponds to the
number shown in the EAnnnn.CHK file name. CHKDSK places all files it creates
in the root directory of the specified drive.
Return Codes:
0 - Normal completion
1 - Not defined
2 - Not defined
3 - Ended by user
4 - Ended due to error
5 - Not defined
6 - CHKDSK was unable to execute file system's CHKDSK program.
o When using CHKDSK on a disk formatted for the High Performance File System
(HPFS), it is important to note how CHKDSK processes lost clusters and how
they are recovered.
CHKDSK does not delete lost clusters. If lost clusters are found and the /F
parameter is specified, CHKDSK recovers lost clusters and does not prompt you
if you want to convert lost chains to files. Instead, CHKDSK creates a
subdirectory of the root directory named \FOUND.mmm and places recovered
files, directories, and extended attributes there. The "mmm" in the directory
name represents a three-digit number so that each directory name is unique.
CHKDSK stores recovered files as files with the naming format: FILEnnnn.CHK.
It stores recovered directories as directories that follow this naming format:
DIRnnnn.CHK.
o When using CHKDSK on a disk formatted for the High Performance File System,
you cannot specify a file by using the filename parameter.
/F Fixes errors found in your directory.
/V Displays all files and their paths on the default
or specified drive.
Filename Displays the number of noncontiguous areas occupied
by the file or files specified.
- CLS
-
Clears the window or entire display screen of any information.
CLS -------------------------------------------------------|
To clear the screen, enter the following:
CLS
- CMD
-
Starts the OS/2 command processor, CMD.EXE, found in the
C:\OS2 subdirectory. To return to the previous command
processor, use the EXIT command.
--|---------|-|--------|--- CMD ----|---------|-|--------|-
|- drive -| |- path -| |- drive -| |- path -|
. . . . . .-----|------|------|------|------|---------------|--------|
|- /Q -| |- /S -| |- /K "string" -|
|- /C "string" -|
Related Commands: ;)COMMAND ;)EXIT ;)SET and ;)START
Type this command without a parameter to start another command processor. To
return to the previous command processor, use the EXIT command.
If you change any environment variables in the current command processor, the
change is known only to the current command processor. For example, suppose
you enter CMD to start another command processor. You then change the prompt
to something other than the default and exit back to the previous command
processor. The previous command processor still has the default prompt.
Use quotation marks to pass significant characters to the new CMD.EXE. To
have a new CMD.EXE process the DIR command and then have the parent CMD.EXE
display the word "HELLO," type the following:
CMD /C DIR & ECHO HELLO
To have the new CMD.EXE process the DIR command and display the word "HELLO,"
type the following:
CMD /C "DIR & ECHO HELLO"
/S Tells the CMD.EXE being started not to install a
signal handler (such as ^C) or a request to
terminate the program.
/K string Allows you to pass a command to CMD.EXE but does
not automatically return to the previous command
processor after the command is completed. The
string is the command you want to pass.
/C string Allows you to pass a command to CMD.EXE and
automatically return to the previous command
processor after the command is completed. The
string is the command you want to pass.
- CODEPAGE
-
Selects the system code pages (defined character sets) to be
prepared by the OS/2 operating system for code-page switching.
You must include the appropriate DEVINFO statements (for
keyboard, printer, and video display) for both code pages in
the CONFIG.SYS file.
CODEPAGE = xxx -------------|--------|--------------------|
|- ,yyy -|
Related Commands: ;)COUNTRY ;)DEVINFO (Display)
;)DEVINFO (Keyboard), and ;)DEVINFO (Printer).
Note that the display and printers each default to a native device character
set. The keyboard and country information default to the national language
code page supported by the country code specified in the COUNTRY statement.
When your computer displays output, the characters used are defined by a
specific code page. Each code page contains letters, numbers, symbols, and
other characters common to a particular country. Each character has a number
(1 to 255) assigned to it. For example, character number 212 might display
one character in the U.S. code page (437), but a different one in the
Portuguese code page (860). Therefore, you should use your default
national-language code page unless you are working with files that were
created using another code page or unless you are planning to send files to
other countries.
When using a file that was created in another code page, you can switch to
that code page or to the multilingual code page. We recommend you use the
multilingual code page (850) whenever possible because it supports many
languages. For example, suppose you create a file using code page 850 and
send it to someone in another country. When that file is viewed or printed
using code page 850, it is identical to your copy. If, however, the file you
send was not created using the multilingual code page, the receiver will need
to switch to the code page that it was created with. Once code pages are
defined on your system, you can switch back and forth between the prepared
code pages.
In the OS/2 operating system, a program or user can change the active code
page. Two pages can be active simultaneously. Code pages for the keyboard,
display, and printer can be set independently; however, code-page switching
can take place only in printers and displays that support code-page switching,
including the following products:
o IBM Enhanced Color Display
o IBM Personal System/2* Displays
o IBM Enhanced Graphics Adapter
o IBM Personal System/2 Video Graphics Array
o IBM Personal System/2 Display Adapter
o IBM Personal System/2 8514/A
o IBM 4201 Proprinters (except Model 001)
o IBM 4202 Proprinter* XL
o IBM 5202 Quietwriter* III.
See your printer information to determine if your printer supports code-page
switching.
Note: If you are going to use the IBM 4207 Proprinter X24 and IBM 4208
Proprinter XL24, you must copy a multilingual code page from a National
Language Support (NLS) diskette. These diskettes are available in countries
outside the United States.
If you plan to switch code pages and are using a code page other than 850, we
recommend that you do not name your files or subdirectories with accented
characters.
- COMMAND
-
Starts the DOS command processor, COMMAND.COM, which is
located in the C:\OS2\MDOS subdirectory.
-|---------||--------|-- COMMAND --|---------||--------|-
|- drive -||- path -| |- drive -||- path -|
. . . . . . .-------|------------|-------|-------------|-------------|
|---- /P ----| |- /C string -|
|--- /E:x ---| |- /K string -|
Related Commands: ;)CMD ;)EXIT ;)SET
Type this command without a parameter to start another DOS command processor.
To return to the previous command processor, use the EXIT command. If
COMMAND.COM is not found in the specified directory, the OS/2 operating system
searches the environment for the value of COMSPEC. This system variable,
which is placed in the environment when a DOS session is started, describes
the path the system uses to reload the command processor. You can change the
value for COMSPEC with the SET command.
If you use the SET command to change any environment variables in the current
command processor, the change is known only to the current command processor.
Returning to the primary DOS command processor with the EXIT command causes a
resumption of the environment that the primary DOS command processor knew
before the secondary copy existed.
/C string Allows you to pass a command to a secondary command
processor and return to the primary command
processor after the command is completed. The
string is a command you want to pass to the command
processor.
- COMP
-
Compares the contents of two files.
-|---------||--------|--- COMP --|---------||--------|-----
|- drive -||- path -| |- drive -||- path -|
. . . . . .-|------------|---|---------|-|--------|-|------------|---|
|- filename -| |- drive -| |- path -| |- filename -|
Related Commands: ;)DISKCOMP
Type this command without a parameter to start a step-by-step menu to compare
files.
The files you compare can be on the same or different drives, or in the same
or different directories. The two sets of files you want to compare can have
the same path and file names, provided they are on different drives. If you
specify only a drive for the second file and do not specify a file name, COMP
assumes that the second file name is the same as the first. If you specify a
drive or path with no file name for either the primary or secondary path and
file name, COMP assumes a file name of *..
After the comparison of the two files, COMP proceeds with the next pair of
files that match the two file names. When COMP cannot find any more files
that match the first parameter, it displays a message asking if you want to
compare more files. Type a Y (Yes) to compare two more files, or end COMP by
entering an N (No).
If the file sizes are different, COMP displays a message informing you of this
and asks if you want to continue. You now have the option to continue the
comparison or end it. If you choose to continue, COMP processes both files
based on the length of the smaller of the two files.
During a comparison, an error message appears for any location that contains
mismatching information in the two files. After 10 mismatches, processing
ends.
COMP does not wait for you to insert a diskette containing a file to be
compared. Therefore, if the file to be compared is on a diskette, enter COMP
without a parameter. COMP then prompts for the file name. Insert the
diskette and enter the name of the file to be compared.
Return Codes
0 - Normal completion.
1 - No files were found to compare.
2 - Some files or directories were not processed because
of file errors.
3 - Ended by user.
4 - Ended because of error.
5 - Files did not compare O.K.
- COPY
-
Copies one or more files. COPY has these format options:
o Append ( + ) files. Use this option when merging multiple files into one
file, or when adding one file to the end of another.
o Change the date and time ( + ,, ). Use this option when you want to change
the date and time of a file, or if you want to update the date and time of a
file after it is copied.
o Combine ( + ) files. Use the combine mode of copy when you can combine
several other copy functions and there is at least one plus sign, and all of
the file name specifications have a common name that can be substituted by a
global file-name character.
o Refer to a device name Use this option when specifying a device (for
example, printer) during the copy process.
COPY -|---------|-|---------- filename -|-----|------|-----
|- drive -| |- path -|------------| |- /A -|
|- filename -| |- /B -|
. . . . . . ---------------|-----|---|------|-------------------------
|- + -| |- ,, -|
|----------------|
|
. . . . . .-|---------|-|--------|--|------------|---|------------|-||
|- drive -| |- path -| |- filename -| |--|- /A -|--|
| |- /B -| |
|---- /V ----|
|---- /F ----|
Related Commands: ;)DISKCOPY ;)RENAME ;)VERIFY ;)XCOPY
You can copy files from one diskette or hard disk to another and you can copy
files within directories. If you want to copy one or more files to a
subdirectory, make sure that the subdirectory exists. For example, if you
enter:
COPY C:\MON C:\REPORTS
and a REPORTS subdirectory does not exist, the system copies the contents of
the MON file to a file named REPORTS. Also, you cannot copy a file to itself.
You can use global file name characters in the source file specification to
change the dates and times of a group of files. If you do not include a
target file specification, all files found that match the source file
specification remain where they are, but their dates and times are changed.
Extended Attributes: COPY preserves any existing extended attributes when the
file is copied (See the /F parameter). An extended attribute is a special
area used for storing data that describes the file or directory to the
operating system or to an application. When copying files and directories
that have extended attributes, be sure to use OS/2 2.0 to ensure all extended
file attributes are copied.
When combining or merging files, you must specify the file that has extended
attributes as the first source file. The first source file cannot be chosen
as the target file.
/B When used with a source filename, causes the entire file
to be copied, including any end-of-file mark.
When used with a target filename, causes no end-of-file
character to be added.
/A When used with a source filename, causes the file to be
treated as an ASCII text file. Data in the file is
copied up to but not including the first end-of-file
mark.
When used with a target filename, causes an end-of-file
character to be added as the last character of the file.
/V Causes OS/2 to verify that the sectors written on the
target disk are recorded properly.
+ Allows you to combine files.
- CREATEDD
-
Creates a dump diskette for use with the Stand-Alone Dump
procedure.
This command is intended to be used with the aid of your technical
coordinator.
---|---------|----|--------|-- CREATEDD ------ target ----|
|- drive -| |- path -| drive
Related Commands: ;)TRACE ;)TRACEBUF ;)TRACEFMT
The CREATEDD utility program prepares a diskette for an OS/2 memory dump. If
a dump requires more than one diskette, the first diskette must be prepared
with CREATEDD while the rest can be any formatted diskettes.
Note: As with other formatting operations, when you use CREATEDD to
format a diskette that already contains information, all of the information on
the diskette is erased.
- DATE
-
Displays or changes the date known to the system and resets
the date on your computer's clock. This date is recorded in
the directory when you create or change a file.
DATE ------------------|--------------------|--------------|
|---- mm-dd-yy ----|
|---- dd-mm-yy ----|
|---- yy-mm-dd ----|
Related Commands: ;)COUNTRY ;)TIME
The OS/2 operating system accepts a slash (/), a period (.), and a dash (-),
as the valid date separator for your country.
Enter this command without a parameter to display the system date and be
prompted about changing it.
It is not necessary to change the date every day because your system hardware
is programmed to change months and years correctly, whether the month has 31,
30, 29, or 28 days. If you must change the date, enter DATE at the command
prompt or from a batch file. If you do not want to change the date shown,
press Enter.
Note that the COUNTRY command in your CONFIG.SYS file allows you to change the
format in which the date is displayed and entered.
- DDINSTAL
-
Provides an automated way to install new device drivers after
the operating system has been installed.
DDINSTAL ------|---------|------|--------|---------------|
|- drive -| |- path -|
Enter this command without a parameter to start a step-by-step procedure with
which you install device-driver files.
These files are provided on a separate diskette called a Device Support
diskette. This diskette contains an xxx.DDP (device-driver profile) file that
controls the installation process. The DDINSTAL program uses the information
from the device-driver profile to add the necessary statements to CONFIG.SYS
and to copy all the support files into their appropriate directories on the
hard disk.
After typing DDINSTAL you are prompted to insert the Device Support diskette
in drive A and to press Enter when ready. If any files are not copied because
they would replace open dynamic-link libraries or programs, those files are
copied to a temporary subdirectory. You are then prompted to insert the
Installation diskette and restart the system. After the system restarts,
DDINSTAL.EXE automatically continues the device driver installation. The
remaining files in the temporary subdirectory are copied and the CONFIG.SYS
statements are added to C:\CONFIG.SYS. After DDINSTAL has installed the
device driver, press Ctrl+Alt+Del to restart the system.
If all of the files are copied successfully from the Device Support diskette,
the statements in the CONFIG.SYS file are added to C:\CONFIG.SYS. Press
Ctrl+Alt+Del to restart the system.
- DEBUG
-
DEBUG |---------|--|--------|--|-------------|-----------------|
|- drive -| |- path -| |- filename --|
Use the DEBUG command without a location and file name to access the DOS DEBUG
environment and be able to enter all DEBUG commands in response to the DEBUG
prompt, a hyphen (-). Refer to the documentation that came with your DOS
operating system for more information about the DEBUG command.
The following is a list of DEBUG commands:
? Displays a list of the DEBUG commands.
A Assembles 8086/8087/8088 mnemonics.
C Compares two portions of memory.
D Displays the contents of a portion of memory.
E Enters data into memory starting at a specified address.
F Fills a range of memory with specified values.
G Runs the executable file that is in memory.
H Performs hexadecimal arithmetic.
I Displays one byte value from a specified port.
L Loads the contents of a file or disk sectors into memory.
M Copies the contents of a block of memory.
N Specifies a file for an L or W command, or specifies the
parameters for the file you are testing.
O Sends one byte value to an output port.
P Executes a loop, a repeated string instruction, a
software interrupt, or a subroutine.
Q Stops the DEBUG session.
R Displays or alters the contents of one or more registers.
S Searches a portion of memory for a specified pattern of
one or more byte values.
T Processes one instruction and then displays the contents
of all registers, the status of all flags, and the
decoded form of the instruction that DEBUG will process
next.
U Disassembles bytes and displays the corresponding source
statements.
W Writes the file being tested to a disk.
XA Allocates expanded memory.
XD Deallocates expanded memory.
XM Maps expanded memory pages.
XS Displays the status of expanded memory.
- DETACH
-
Starts and simultaneously detaches an OS/2 program from its
command processor.
DETACH ------------------ command -----------------------|
Any program that is started with DETACH must be able to process programs
independently outside the control of the command processor. DETACH should not
issue any input or output calls to the keyboard, the mouse, or the display.
You can detach any program, command, or file that does not require the use of
a screen (for example, internal commands and batch (.CMD) files). The OS/2
operating system detaches CMD.EXE when it runs the internal command or batch
file. For example, if you type DETACH DIR, it is changed to the equivalent of
DETACH CMD.EXE /C DIR.
CMD.EXE uses the value of the COMSPEC environment variable to locate the
CMD.EXE that should be detached before it runs internal commands and batch
files.
You can use DETACH with redirection sequences to redirect a program's standard
input and output to devices other than the keyboard and the display. This
allows the program to run noninteractively.
- DIR
-
Lists the files and subdirectories in a directory.
DIR ---|---------|-|--------|-|------------|--|-----------
|- drive -| |- path -| |- filename -| |
| |
|----------------------------------------|
|-------------------------|
|
. . . . . . . . . . . . . . . . . . . --------|--|------|--|---------|
| |--/W -| |
| |- /F -| |
|---- /P ----|
|---- /N ----|
|---- /A ----|
|---- /B ----|
|---- /O ----|
|---- /R ----|
|---- /S ----|
|---- /L ----|
Related Commands: ;)CHDIR ;)MKDIR ;)RMDIR ;)TREE
Typing DIR, without a parameter, lists the files in the current directory.
You can also:
o List the files in the parent directory of the current
directory by typing DIR ..
o Send the directory listing to your printer by typing DIR
>PRN
The system displays the name, size (in bytes), and the date and time you
placed the information in the file. DIR also displays the disk volume label
and volume serial number. It also gives the total number of files, the number
of bytes used in the files displayed, and the amount of free space (in bytes)
remaining on the disk.
Note that directory entries for hidden system files are not listed, even if
they are present. Also, if you do not specify a file name extension, the
default is *, which indicates that all files with that file name (regardless
of the extension) should be displayed. DIR displays files consecutively on
the screen if you specify multiple file names. You can include a drive and
path when specifying multiple file names and may also use the global file-name
characters * and ? in the file name you specify.
- DISKCOMP
-
Compares the contents of the diskette in the source drive to
the contents of the diskette in the target drive.
---|---------|-|--------|--------------- DISKCOMP ---------
|- drive -| |- path -|
. . . . . .--|----------------|----|----------------|----------------|
|- source drive -| |- target drive -|
Related Commands: ;)DISKCOPY
Enter this command without a parameter to start a step-by-step procedure to
compare the contents of diskettes in different diskette drives.
DISKCOMP does not work in DOS sessions on drives that have an ASSIGN, JOIN, or
SUBST command in effect. Also, DISKCOMP does not work on network drives.
Observe these restrictions when using DISKCOMP:
o Use DISKCOMP only between diskettes of the same size and
storage capacity.
o Do not use DISKCOMP to compare information between 5.25-
inch and 3.5-inch diskettes.
o Follow the examples under the COMP command to compare
files between 5.25-inch and 3.5-inch media.
Return Codes DISKCOMP issues a return code of 0 for normal completion or
displays the appropriate error message.
- DISKCOPY
-
Copies the contents of the diskette in the source drive to the diskette in the
target drive. If necessary, the target diskette is formatted during the copy.
Neither the source nor the target drive can be a hard disk or a virtual drive.
DISKCOPY also displays the volume serial number of the target diskette.
---|---------|-|--------|--------------- DISKCOPY ---------
|- drive -| |- path -|
. . . . . .--|----------------|----|----------------|----------------|
|- source drive -| |- target drive -|
Related Commands: ;)DISKCOMP
DISKCOPY does not work in DOS sessions on drives that have an ASSIGN, JOIN, or
SUBST command in effect.
It is important to note that DISKCOPY automatically formats (prepares) the
target diskette with the same number of sides and sectors per track as the
source diskette before copying the contents of the source diskette to it.
Observe these restrictions when using DISKCOPY:
o Use DISKCOPY only between diskettes of the same size and
storage capacity.
o Do not use DISKCOPY to copy information between 5.25-inch
and 3.5-inch diskettes. Follow the examples under the
COPY command to copy files between 5.25-inch and 3.5-inch
diskettes.
Because of the OS/2 multitasking operating environment, DISKCOPY locks the
diskettes to prevent any other program from reading or writing to the
diskettes while copying is being performed. If errors are detected on either
diskette during the copy operation, DISKCOPY shows the drive, track, and side
where it found the error, and proceeds with the copying.
Return Codes: DISKCOPY issues a return code of 0 for normal completion or
displays the appropriate error message.
Note: D1 and d2 may be the same. In that instance, DISKCOPY uses just
one drive to perform the copy. DISKCOPY will prompt you to insert diskettes
as necessary.
- DOSKEY
-
Recalls DOS commands, edits command lines, and creates macros.
-----|---------|----|--------|----- DOSKEY ---------
|- drive -| |- path -|
|--------------------|
|
. . . . . . . . . -------|---------------|-|-|----------------|------|
|- /REINSTALL --| | Macroname=text |
|- /BUFSIZE=n --|
|------ /M -----|
|------ /H -----|
||-/OVERSTRIKE-||
|-- /INSERT --|
Recalling a Command
To recall a command, use the following keys:
Up Arrow Recalls the DOS command you used before the
one displayed.
Down Arrow Recalls the DOS command you used after
the one displayed.
Page Up Recalls the first DOS command you used in
the current session.
Page Down Recalls the most recent DOS command you used.
Editing the Command Line
To edit the current command line, use the following DOSKEY
editing keys:
Left Arrow Moves the cursor back one character.
Right Arrow Moves the cursor forward one character.
Ctrl+Left Arrow Moves the cursor back one word.
Ctrl+Right Arrow Moves the cursor forward one word.
Home Moves the cursor to the beginning of the line.
End Moves the cursor to the end of the line.
Esc Clears the command from the screen.
F1 Copies one character from the template to the
DOS command line.
F2 Searches forward in the template for the next
key you type after pressing F2. DOSKEY
inserts the text from the template up to but
not including the character you specify.
F3 Copies the remainder of the template to the
command line. DOSKEY begins copying characters
from the position in the template that
corresponds to the position indicated by the
cursor on the command line.
F4 Deletes characters, beginning with the first
character in the template, up to a character
you specify.
F5 Copies the current command into the template
and clears the command line.
F6 Places an end-of-file character (Ctrl+Z) at
the end of the current command line.
F7 Displays all commands stored in memory with
their associated numbers. These numbers are
assigned in order from the first command to
the most recent.
Alt+F7 Deletes all commands stored in memory.
F8 Searches memory for a command that you want
DOSKEY to display. To use this editing key,
type the first few characters of the command
you want to find and press F8. The commands
that start with the characters you specified
are displayed beginning with the most recent
as you repeat pressing F8.
F9 Prompts you for a command number and displays
the command associated with the number you
specify.
Alt+F10 Deletes all macro definitions.
Creating a Macro
To create macros that process one or more DOS commands, use
the following special characters to control command
operations:
$G or $g Redirects output. Use these special
characters to send output to a device or a
file instead of to the screen. These
characters are equivalent to the output
redirection symbol (>).
$G$G or $g$g Appends output to the end of a file
rather than replacing the data in the
file. These double characters are
equivalent to the (>>) symbols for
appending redirected output.
$L or $l Redirects input. Use these special
characters to read input from a device or
a file instead of from the keyboard.
These characters are equivalent to the
redirection symbol for input (<).
$B or $b Sends macro output to a command. These
characters are equivalent to the pipe (|).
$T or $t Separates commands. Use these special
characters to separate commands when you
are creating macros or typing commands at
a DOS command prompt.
$$ Specifies the dollar-sign character ($).
$1 through $9 Represents any command-line information
you want to specify when you run a macro.
These special characters are batch
parameters that enable you to use
different data on the command line each
time you run a macro. The $1 character
in a DOSKEY command is similar to the %1
character in a batch program.
$* Represents all the command-line information
you want to specify when you run a macro.
Everything you type on the command line after
a macro name is substituted for the $* in the
macro.
Running a Macro
To run a macro, type the macro name starting at the first position on the
command line. If the macro was defined with $* or any of the batch parameters
$1 through $9, use a space to separate parameters.
Creating a Macro with the Same Name as a DOS Command
You might want to create a macro with the same name as a DOS command. This
can be useful, for example, if you always use a certain command with specific
parameters. To specify whether you want to run the macro or the DOS command,
follow these guidelines:
o To run the macro, begin typing the macro name immediately
after the command prompt, with no space between the
prompt and the command name.
o To process the command, insert one or more spaces between
the command prompt and the command name.
- DPATH
-
Gives application programs the search path to data files that are outside the
current directory. The DPATH environment variable can only be set using the
SET command in OS/2 sessions.
DPATH ----------|---------|---- path -------|-------------|
|- drive -| |
| |
|------------- ; --------------|
Related Commands: ;)APPEND ;)PATH and ;)SET
Typing DPATH without a parameter displays the current value of the DPATH
environment variable. Typing DPATH ; clears the DPATH environment variable.
DPATH indicates what directories applications should search for their data
files (if an application program uses the DPATH directory list).
DPATH is a system environment variable, which means that application programs
can query the environment for its value, and, depending on what they find,
change their behavior.
Like the PATH command, the number of directories you can specify with DPATH is
limited only by the length of the command line. The length of a DPATH command
can be up to six characters less that the maximum number of characters allowed
on the command line. Once you set a search path for data files with DPATH,
the path remains in effect for the current command processor until you replace
it with another DPATH command.
DPATH differs from the APPEND command in how it operates. DPATH tells
applications what directories it should search in order to find data files,
and it is up to the applications to recognize DPATH. With the APPEND command,
however, application programs are able to find files without recognizing that
the APPEND command is in effect.
- EAUTIL
-
Allows you to split (save) extended attributes from a file and
then rejoin the extended attributes to the file.
EAUTIL --- datafile --|------------|---|---------------|---
|- holdfile -| |- /S -|------|-|
| |- /R -| |
|- /J -|------|-|
|- /O -|
|- /M -|
. . . . . . ----------|------|---------------------------------------|
|- /P -|
Related Commands: ;)IFS
An extended attribute is a mechanism that allows an application to attach
information to a file or directory (file system object). Extended attributes
are used to describe the object to another application, to the operating
system, or to the file system program that manages the file or directory.
EAUTIL allows you to split extended attributes from a data file or program
file and place them in a hold file as data. After you do this, you can use
the file with other applications or file systems that do not recognize or are
not able to process extended attributes. By saving extended attributes to a
hold file, you prevent them from being erased or lost. The command also
allows you to join extended attributes contained in the hold file to the data
file.
Return Codes:
0 - Normal completion
1 - File not found
4 - Ended due to error
- ERASE or DEL
-
Deletes one or more files. Use ERASE or DEL interchangeably.
ERASE -|--|---------|-|---------- filename -|-|--|------|-|
| |- drive -| |- path --|------------| | |- /P -|
DEL ---| | |- filename -| | |- /N -|
|-------------------------------------|
Do not use ERASE or DEL to delete a subdirectory name; use the remove
directory (RD/RMDIR) command. You can use ERASE or DEL to delete the contents
of a subdirectory. In addition, read- only and hidden files, such as the
operating system files of IBMBIO.COM and IBMDOS.COM, cannot be deleted.
When erasing all files in a directory, the system displays the name of the
directory, along with the message:
Are you sure (Y/N)?
Enter a Y (yes) to erase all the files in the directory or
enter an N (no) to end the DEL or ERASE command.
- EXIT
-
Ends or closes the current command processor (CMD.EXE or
COMMAND.COM) and returns to the previous one, or to the
desktop if no previous session exists.
EXIT ------------------------------------------------------|
Related Commands: ;)CMD and ;)COMMAND
To close the current command processor and return to the previous command
processor, or the desktop, enter EXIT.
If you are running a program, you must first end the program before typing
EXIT. If no previous command processor exists, typing EXIT returns you to the
desktop.
- FDISK
-
Allows you to create or delete a primary partition or a
logical drive in an extended partition.
---|---------|-|--------|------------ FDISK -------------|
|- drive -| |- path -|
---|---------|-|--------|------------ FDISK -------------
|- drive -| |- path -|
|---------------------|
|
. . . . .-------------|------ /QUERY -------|--|-------------------|||
|------ /CREATE ------| |--- /NAME:name ---|
|------ /DELETE ------| |----- /DISK:n -----|
|-- /SETNAME:name ---| |----- /FSTYPE:x ---|
|- /SETACCESS -| |----- /START:m ----|
|---- /STARTABLE -----| |----- /SIZE:m -----|
|-- /FILE:filename ---| |----- /VTYPE:n ----|
|--- /BOOTABLE:s ---|
|--- /BOOTMGR ------|
Related Commands: ;)FDISKPM ;)SETBOOT
Related Information: Hard Disk Information
o The Fixed Disk Utility (FDISK) - Full-screen
The full-screen version of FDISK is used during installation of the operating
system. It provides users with the same functions as the FDISKPM version.
The full-screen version supports windows and looks and acts much the same as
FDISKPM but it does not support a mouse.
o The Fixed Disk Utility (FDISK) - Command Line
Use the FDISK command at the command prompt to establish or change partition
values. Use the parameters and options with the FDISK command to specify and
limit the values and characteristics of the partitions.
The following syntax shows how to use the FDISK command to take advantage of
the Boot Manager for unattended environments:
FDISK /parameter:value /option:value
The Boot Manager allows you to create up to four primary partitions on a hard
disk. A primary partition is an area on the hard disk that cannot be shared.
A partition that cannot be shared means that only one entity can reside there
and only one primary partition can be active at one time. The data of an
operating system in a primary partition cannot be accessed by an operating
system in another primary partition but it can be accessed by a logical drive
in an extended partition.
You can create an extended partition in place of one of the four primary
partitions. This partition can be subdivided into multiple logical drives.
You can install a different operating system on each of the logical drives.
These logical drives are shareable; any data installed on these logical drives
can be used by an operating system running from any other logical drive on
your system, if the file systems are compatible.
Note: All versions of DOS must be in a primary partition. Other
operating
systems can be installed on logical drives in an extended partition.
Return codes: FDISK issues a return code of 0 for normal completion or the
appropriate error message.
- FDISKPM
-
Allows you to create or delete a primary partition or a
logical drive in an extended partition.
---|---------|-|--------|------------ FDISKPM -------------|
|- drive -| |- path -|
Related Commands: ;)FDISK
Related Information: Hard Disk Information
FDISKPM presents menus and displays to guide you through the tasks necessary
to set up your hard disks. Help is available for all selectable items and
entry fields within FDISKPM.
You can use the choices on the Options menu to:
o Install the Boot Manager partition.
o Create a primary partition or logical drive.
o Add a partition to the Boot Manager menu.
o Change the partition name.
o Assign the accessibility of primary partitions.
o Specify startup values such as a default partition,
startup selection time, or mode for the Boot Manager
menu.
o Remove a partition from the Boot Manager menu.
o Delete a primary partition or logical drive.
o Set a primary partition as installable.
o Specify a primary partition as being startable.
o Exit FDISKPM.
- FIND
-
Searches for a specific string of text in a file or files and
sends the specified lines to your output device.
|----------------------|
|
--|---------|-|--------|-- FIND ----|----------------|---|--
|- drive -| |- path -| |-|--- /V -----|-|
| |--- /C -----| |
|----- /I -------|
|----- /N -------|
. . . . . .-- "string" ---|---------|-|--------|--- filename ----|---|
|- drive -| |- path -| |
| |
|----------------------------------------|
It is important to note:
o You must type the phrase or word in quotation marks in the exact format
(uppercase or lowercase) in which it is written in the text. Two single
quotes in succession are not equivalent to quotation marks.
o When searching for strings that contain quotation marks, an extra set of
quotation marks must be entered both before and after the string. For
example, to find the string "Quotation Marks" in a file named PUNCTUATION,
enter the following:
FIND ""Quotation Marks"" PUNCTUATION
o You must specify the specific file name you want the FIND command to search.
Global characters such as the asterisk (*) or question mark (?) do not work.
o You can specify parameter /V together with /C or /N, but parameter /N cannot
be used with /C.
o Within a search string containing quotation marks, you can represent
quotation marks by preceding the double quotation mark character with a
backslash (\). For example:
FIND "SAY \"Hello\"" FILE1
Return Codes: FIND issues a return code of 0 for normal completion.
/C Display a count of matching lines
/V Display all lines not containing text.
/N Display line number
- FOR
-
Allows repetitive running of OS/2 commands.
To use FOR from the OS/2 command prompt:
FOR --- % variable --- IN --- (set) --- DO ---- command ---|
To use FOR from a batch file:
FOR ------ %%c ------- IN ---- (set) ---- DO ---- command -|
It is important to note that:
o The items in parentheses specify the "set," which can include file and path
names.
o An item in the set can contain the global file-name characters * or ?.
o Use only one percent sign ( % ) before the variable if you are processing
from the command prompt; use two percent signs ( %% ) if you are using the
variable in a batch file.
o For OS/2 sessions, piping and redirection can be used with the FOR command.
The following example shows three C-language program files being compiled and
compiler messages being saved in three files that have a .OUT extension.
FOR %1 IN ( FILE1 FILE2 FILE3 ) DO CL /C %1.C > %1.OUT
2>&1
For DOS sessions, piping and redirection are not used with the FOR command.
o For OS/2 sessions, you can specify more than one FOR command at a command
prompt.
For example, type the following in order to print these files: FILE1.C,
FILE1.LST, FILE2.C, FILE2.LST, FILE3.C, FILE3.LST:
FOR %1 IN ( FILE1 FILE2 FILE3 ) DO FOR %J IN ( C LST ) DO
PRINT %1.%J
In the following example, FOR sequentially sets the %%D parameter to each item
in the set and then evaluates the command you want to run (TYPE).
Assume you want a batch file to process the commands, TYPE FILE1 and TYPE
FILE2, and have the result be the same as if you typed both commands from the
command prompt:
FOR %%D IN (FILE1 FILE2) DO TYPE %%D
Assume you want to process the commands TYPE FILE1 and TYPE FILE2 from the
command prompt:
FOR %H IN (FILE1 FILE2) DO TYPE %H
- FORMAT
-
Formats a disk in the specified drive to accept OS/2 files by marking the
directory and file allocation tables on the disk. FORMAT also checks the disk
for defects.
-----|---------|----|--------|----- FORMAT ---- drive -----
|- drive -| |- path -|
|-------------------------|
|
. . . . . .--------------|---------------------||--------------------|
|--- /ONCE -----------|
|--- /4 --------------|
|--- /T:tracks -------|
|--- /N:sectors ------|
|--- /F:xxxx ---------|
|--- /FS:xxxxx -------|
|--- /L --------------|
|--- /V -|----------|-|
|- :label -|
Related Commands: ;)IFS ;)LABEL and ;)VOL
If you format a drive for the High Performance File System, FORMAT checks the
IFS statement in the CONFIG.SYS file to determine if the drive is listed with
the /AUTOCHECK parameter. If the drive is listed, FORMAT does not update the
IFS statement. If the drive is not listed, FORMAT adds the drive letter.
If you format a diskette or hard disk that already contains information, all
the information is erased. Also, be sure to specify a drive letter, followed
by a colon (for example, A:); otherwise, the system displays an error message
that you have not specified a target drive.
Be sure to set up an OS/2 partition on all hard disks before formatting them.
FORMAT does not recognize a hard disk as being an OS/2 disk if an OS/2 or a
DOS partition does not exist. When FORMAT finds such a disk, it skips to the
next disk and begins formatting it.
Do not attempt to format a diskette to an incorrect capacity, because such a
diskette will not store your data reliably.
By default, the FORMAT command attempts to format the media to the maximum
capacity of the diskette drive. The /F:xxxx parameter allows you to format
3.5-inch diskettes to less than the maximum capacity of the diskette drive.
FORMAT does not work on drives that have an ASSIGN, JOIN, or SUBST command in
effect. Also, FORMAT does not work on network drives.
FORMAT does work on the IBM read/write optical disc drive. To format and
install the file system on an optical disc the first time requires about 20
minutes using the /L parameter. Reformatting a previously formatted optical
disc requires only a few minutes when you do not use the /L parameter.
Return Codes:
0 - Normal completion
3 - Ended by user
4 - Ended due to error
5 - Ended due to NO response when user was prompted to
format a hard disk
6 - FORMAT was unable to process another file system's
format program
7 - Volume not supported by another file system's format
program.
/F:360 /F:720 /F:1.2 /F:1.44
/FS:HPFS /FS:FAT
- FSACCESS
-
|--------------------------------------|
|
FSACCESS ----|-----|-|-------------------------|--|--|
|- ! -| |------- DOSletter -------|
|- DOSletter - DOSletter -|
|-- DOSletter = OS2drive -|
Related Commands: ;)FSFILTER ;)VMDISK
Related Information: Starting a Specific Version of DOS
FSACCESS can be called multiple times to re-assign drive letters, make new
drives accessible, or remove access to drives. Drives cannot be in use (the
current drive) when remapped.
When a specific version of DOS is started from an image file, references to
drive A in that session access the image file. The use of the physical
diskette drive A is not available.
The command
FSACCESS A:
closes the image file and maps drive letter A to the physical diskette drive
A.
Note: Specifying no parameters displays the current drive mappings.
- GRAFTABL
-
Loads a table of additional characters into memory for graphics mode. Because
GRAFTABL is a DOS command, it has no effect on OS/2 sessions.
--|---------|-|--------|--- GRAFTABL ---|------------|-----|
|- drive -| |- path -| |---- nnn ---|
|---- ? -----|
|--- /STA ---|
Enter this command without a parameter to display the current graphics
code-page table that is loaded.
GRAFTABL allows the ASCII extended character set to be displayed when display
adapters are being used for graphics. GRAFTABL works only for modes 4, 5, and
6 of the Color Graphics Adapter, Enhanced Graphics Adapter, and Video Graphics
Array.
Return Codes:
0 - No previously loaded character table exists and a
code page is now resident.
1 - A previously loaded character table exists. If a new
table was requested, it replaces the previous table at
its original location.
2 - No previously loaded character table exists and no
new table is loaded.
3 - Incorrect parameter
4 - Incorrect DOS version
- HELP
-
Provides a help line as part of the command prompt, displays help information
for warning and error messages, or displays a specific topic within a book.
--|---------|-|--------|--- HELP ----|-------------------|-|
|- drive -| |- path -| |------ ON --------|
|------ OFF -------|
|--- message help --|
||--------|- topic -|
|- book -|
Enter this command without a parameter to display the HELP options available
for the current mode of operation. These options allow you to:
o Return to the desktop.
o Switch to the next session
o Exit the current OS/2 session
o Get additional help on error and warning messages.
If you are writing an application program or working with unfamiliar software,
it is advisable to specify HELP OFF, or messages from your program might not
appear on the display screen.
If you specify HELP ON, the value of the PROMPT environment is overwritten
until you specify HELP OFF. Specifying HELP OFF resets the prompt back to the
default system prompts for DOS and OS/2 sessions.
To request help for a message, enter HELP with the message number. HELP then
displays the original message, which is usually followed by explanation and
action statements. If the original message contains variable data, such as
the name of a file, HELP substitutes three asterisks (***) for the variable
data when it responds to your help request. In addition, if you enter an
incorrect message ID, you get a message stating "No help is available for the
message ID number requested."
If HELP is unable to find the help message file (OSO001H.MSG) in the current
directory, it searches for the file in the directories contained in the DPATH
and APPEND statements.
- JOIN
-
Logically connects a drive to a directory on another drive. Therefore, you
can access a drive by a directory name instead of a drive letter. You can
join a drive only at the root directory.
-|---------|-|--------|------ JOIN ------- drive ----------
|- drive -| |- path -|
. . . . . .--------- drive\directory ------|------|------------------|
|- /D -|
Related Commands: ;)ASSIGN ;)SUBST
Enter this command without a parameter to display the names of the drives
currently joined.
If the directory name does not exist, the OS/2 operating system creates a
directory on the drive you specify. A directory that already exists must be
empty for the JOIN to work. Also, after you issue the JOIN command, the first
drive name is no longer correct, and if you try to use it, the operating
system displays an error message.
Note that the following commands do not work in DOS sessions on drives that
have a JOIN command in effect:
CHKDSK DISKCOMP DISKCOPY FORMAT
LABEL RECOVER RESTORE
/D Switch to undo the join and return the drive with all its
files to its original location.
Note: Entering the command without parameters displays the drives that
are currently joined.
- KEYB
-
Selects a keyboard layout to replace the current keyboard layout for all OS/2
and DOS sessions.
--|---------|-|--------|-- KEYB -----|----------|---------
|- drive -| |- path -| |- layout -|
. . . . . . -----------|--------------|------------------------------|
|- subcountry -|
Related Commands: ;)CODEPAGE ;)COUNTRY and ;)DEVINFO
If your CONFIG.SYS file contains a keyboard DEVINFO statement, then you have
the ability to switch keyboard layouts using KEYB. If there is no keyboard
DEVINFO statement in the CONFIG.SYS file, typing KEYB with any layout returns
an error message. Typing KEYB without a layout parameter, whether there is a
DEVINFO statement or not in your CONFIG.SYS file, causes the current keyboard
code-page information to be displayed.
KEYB is useful for quickly accessing the keyboard characters of another
keyboard layout. KEYB must be run only from an OS/2 full-screen command
prompt. Running KEYB from a command prompt of an OS/2 window creates
unexpected results.
KEYB prepares the keyboard in the selected layout for the system code pages.
A message is displayed when the code pages that are set in the CODEPAGE
statement in the CONFIG.SYS file do not match the code pages associated with
the layout that is being processed by KEYB. Enter a Y (yes) to load the
default layout or an N (no) to end the KEYB command without loading the
requested keyboard layout. Loading the default layout for a keyboard that
does not match the country physical keyboard layout is recommended only for
users who understand the implications for character mismatch. If you choose
to load the default layout, certain characters typed at the keyboard and read
by a program may not match the characters shown on the keytops. Also,
characters entered from the keyboard could be displayed incorrectly on the
screen.
If you use KEYB to switch to a keyboard layout where the keyboard code page
does not match the system code pages, and you decide that the potential
problems with using the default layout are too great, you must change the
CODEPAGE statement in the CONFIG.SYS file to match the keyboard code page
associated with the keyboard layout that you are trying to load.
If you want characters displayed in the same default code page for the layout
you specified using KEYB, change the CODEPAGE statement in the CONFIG.SYS
file.
The DEVINFO statement specifies the keyboard layout that the system is to
start in, if all other required CONFIG.SYS parameters are correct. If you do
not specify a DEVINFO statement in your CONFIG.SYS file, the U.S. keyboard
layout (US) is the default. You cannot, however, use the KEYB command if no
DEVINFO statement is given. Only one DEVINFO is required (for the starting
keyboard layout). KEYB can be issued for any valid country layout, provided
code-page support for that country has been prepared.
- KEYS
-
Permits previously issued commands to be retrieved and edited.
KEYS -----------------|----------------|-------------------|
|------ OFF -----|
|------ ON ------|
|------ list ----|
Enter this command without a parameter to display the status of the KEYS
command.
Entering KEYS ON disables ANSI extended keyboard support in OS/2 sessions.
The amount of memory for the command queue cannot exceed 64KB. When the queue
is full, the oldest command is discarded as new commands are entered from the
keyboard.
Entering KEYS ON or KEYS OFF at the command prompt, sets an environment
variable named KEYS with a value of ON or OFF. CMD.EXE checks the KEYS
environment variable when it starts and determines if KEYS is set to ON. If
so, CMD.EXE acts as an implicit KEYS ON command.
KEYS ON Editing
KEYS OFF Editing
- LABEL
-
Creates or changes the volume identification label on a disk.
--|---------|-|--------|-- LABEL --|---------|-|---------|-|
|- drive -| |- path -| |- drive -| |- label -|
Related Commands: ;)VOL
Enter this command without a parameter to display the current label and volume
serial number. LABEL prompts you if you want to change it. Type a volume
label up to 11 characters long and press Enter. If you press Enter without
entering a label, the volume label remains unchanged.
Any leading blanks entered before a volume label are removed from the label,
and the first letter of the label is automatically positioned at the first
digit space allowed for the label.
LABEL does not work in DOS sessions on drives that have an ASSIGN, JOIN, or
SUBST command in effect. Also, LABEL does not work on network drives.
Return Codes: The LABEL command issues a return code of 0 for normal
completion.
- MAKEINI
-
System settings, such as application defaults, display options, and file
options, are contained in the OS2.INI startup file located in the C:\OS2
directory of your hard disk. There is also a system file called OS2SYS.INI,
which contains information about installed fonts and printer drivers.
---|---------|----|--------|--- MAKEINI ---|----------|---|
|- drive -| |- path -| |-- user --|
|- system -|
If you receive a message stating that the OS2.INI file is corrupted, the
OS2.INI file installed on your system must be replaced by another valid copy
of the OS2.INI file.
To accomplish this, use the MAKEINI program from your command prompt.
Added to your system during the installation process, the MAKEINI.EXE file
creates a new OS2.INI file containing default information. You should
re-create both the user and system INI files using MAKEINI (located in the
C:\OS2 directory of your hard disk).
Note: You can rename the OS2.INI and OS2SYS.INI files to names of your
choice as long as the same file names are reflected in the PROTSHELL statement
in the CONFIG.SYS file.
- MEM
-
Displays the amount of used and free memory in the DOS environment.
MEM ------------------|------|---------------------|
|- /P -|
|- /D -|
|- /C -|
Related Commands: ;)CHKDSK
Use the MEM command to display information about allocated memory areas, free
memory areas, and programs that are currently loaded into memory.
- MKDIR or MD
-
Makes new subdirectories within the root directory (the directory you are in
when the OS/2 operating system starts) or within another subdirectory. MKDIR
creates a multilevel directory structure, which is helpful in keeping related
program or data files together.
MKDIR ----|---------|---------|------ path ----|----------|
MD --| |- drive -| |
| |
|------------------------------|
Related Commands: ;)CD ;)DIR ;)RD and ;)TREE
Enter this command with a directory name to create a subdirectory within the
current directory. Do not use the backslash (\) symbol if you have changed
directories and you want to create a subdirectory in your current directory.
If you use the backslash symbol, the subdirectory is created within the root
directory.
Each directory can contain file and directory names that also appear in other
directories. In other words, two or more files or directories can have the
same name, if you define them in separate directories.
- MODE
-
Sets operation modes for devices.
MODE------------------ device --------|-------------|-----|
|- arguments -|
There are four different MODE commands you can use:
COM# Sets asynchronous communications modes.
Display Sets the display modes for video adapters.
LPT# Sets parallel printer modes.
DSKT Sets diskette input/output write verification.
- MORE
-
Reads data from the standard input device and sends data to the standard
output device (usually the display) one full screen at a time. After each
screen, the OS/2 operating system pauses with the message --More-- until you
press any key to continue.
-----|---------|----|--------|-------- MORE ---------------|
|- drive -| |- path -|
Related Commands: ;)FIND ;)SORT
"One screen at a time" does not imply one physical window's worth of
information at a time when used in a window session.
MORE is useful for viewing long files or directories. To view the next
screen, press any key. However, if you do not want to continue, press the
Ctrl and Break keys together.
Return Codes: The MORE command issues a return code of 0 for normal
completion.
- MOVE
-
Moves one or more files from one directory to another directory on the same
drive.
MOVE ----|---------|-----|---------- filename -|----------
|- drive -| |- path -|------------|
|- filename -|
. . . . . .-----------|--------|---|------------|--------------------|
|- path -| |- filename -|
You can use the global file-name characters ? and * in the filename parameter
of both the source and target files. If you type global characters in the
source file name, the names of the files will be displayed as the files are
being moved.
- PATCH
-
Allows you to apply IBM-supplied patches to make repairs to software.
---|---------|-|--------|----- PATCH -----|---------|-----
|- drive -| |- path -| |- drive -|
. . . . . .--|--------|---- filename.ext -----|------|---------------|
|- path -| |- /A -|
PATCH should be used only by those who understand the need for a patch, how to
make a patch, and the effect the patch has on the operation of a program.
PATCH has prompts that guide you through inserting changes to the operating
system's software.
If you select the /A option to automatically apply patches shipped by IBM to
make fixes to IBM-supplied code, verification is performed before the patch is
applied. Verification might not be done on non-IBM-supplied patches.
If you decide to manually apply a patch by entering the command without any
options, you are asked to supply an offset to indicate where the patch is to
be made. PATCH displays the contents of the location specified by the offset
and allows you to enter the patch. You must enter both the offset and the
patch contents in hexadecimal notation.
When you supply a hexadecimal offset, the operating system displays the 16
bytes at that offset and you can change any or all 16 bytes or quit without
making any changes. The cursor is initially positioned on the first byte.
You can type one or two hexadecimal digits to change this byte or press the
Spacebar to leave the byte unchanged and move to the next byte. You can press
Backspace to move the cursor to the previous byte if you make a mistake. You
can continue changing bytes until you press Enter. If you move the cursor
past the 16th byte, the operating system displays the next 16 bytes, allowing
you to also change those bytes.
After you press Enter, the patch information is saved in memory and the
following message is displayed:
Do you want to continue patching filename (Y/N)?
If you enter Y (yes), PATCH prompts for an offset. PATCH also saves any more
patch requests in memory. When you have entered all patches, the operating
system displays them on your screen and asks you to verify that they should be
applied. If you respond with a Y, all the saved patch requests are written to
the disk in the same order in which you entered them.
If you specify automatic mode (/A), PATCH gets the information needed from a
patch information file received from IBM.
Return Codes: PATCH issues a return code of 0 for normal completion.
- PATH
-
Sets a search path for commands and programs.
PATH -----------|---------|---- path -------|-------------|
|- drive -| |
| |
|------------- ; --------------|
Related Commands: ;)APPEND ;)DPATH and ;)SET
Enter this command without a parameter to display the paths currently in
effect. To delete the use of the PATH command, enter the command followed by
a semicolon ( ; ).
Setting the PATH in the CONFIG.SYS and AUTOEXEC.BAT files lets you avoid
having to set PATH from the command prompt each time you turn on your system.
As you create your own subdirectories, you can change the PATH statement in
your CONFIG.SYS to reflect your new directory structure. For DOS sessions,
you update the PATH statement in your AUTOEXEC.BAT file.
PATH searches specified directories for commands or batch files that the
system did not find when it searched the current directory. PATH only finds
files that can be run, such as files with the following extensions: .COM,
.EXE, and .BAT (for DOS sessions), or .CMD (for OS/2 sessions).
PATH is a system environment variable. If the system cannot find an external
command or program in your current directory, it queries the environment for a
value for PATH. Application programs can also query the environment for the
value of PATH and, depending on what they find, change their behavior.
If you enter a command that is not found in the current directory, the system
searches the named directories in the order in which you entered them. The
length of a path can be up to five characters less than the number of
characters allowed on the command line.
When you install the OS/2 operating system, the installation program places
the following PATH statement in your CONFIG.SYS file:
SET PATH=C:\OS2;C:\OS2\SYSTEM;C:\OS2\MDOS;C:\OS2\INSTALL;C:\;
System installation also creates the following PATH statement in your
AUTOEXEC.BAT file for use with DOS sessions:
PATH C:\OS2;C:\OS2\MDOS;C:\;
- PICVIEW
-
Displays a picture file.
PICVIEW -|---------|-|--------|- filename -|--------|-|------|--|
|- drive -| |- path -| |- /MET -| |- /P -|
|- /PIF -| |- /S -|
You can select Picture Viewer from the Productivity folder or issue a PICVIEW
command at an OS/2 command prompt.
If you enter PICVIEW without a parameter at the OS/2 command prompt, the
Picture Viewer window appears. If you type PICVIEW with a file name, PICVIEW
starts displaying the picture file immediately. If you do not specify a file
name, you can select the files to be displayed from the Picture Viewer window.
To return to the OS/2 command prompt, you must select Exit from the Picture
Viewer window.
- PMREXX
-
Displays output from REXX procedures and provides an input field for them.
---|---------|-|--------|---------- PMREXX------------
|- drive -| |- path -|
---|---------|-|--------|-- filename --|-------------|-|
|- drive -| |- path -| |- arguments -|
PMREXX is a Presentation Manager* window application that enables you to
browse the output of your REXX procedures.
You start the PMREXX program and a REXX procedure from an OS/2 command prompt.
You do this by typing PMREXX and a target procedure name that generates an
output or input function, as follows:
PMREXX filename.CMD arguments
where the arguments and .CMD extension are optional.
By using PMREXX, you add the following features to REXX:
o A window for the display of the output of a REXX procedure, such as:
- The SAY instruction output
- The STDOUT and STDERR outputs from secondary processes
started from a REXX procedures file
- The REXX TRACE output (not to be confused with OS/2
tracing).
o An input window for:
- The PULL instruction in all of its forms
- The STDIN data for secondary processes started from a
REXX procedures file.
o A browsing, scrolling, and clipboard capability for REXX
output.
o A selection of fonts for the output window.
o A simple environment for experimenting with REXX
instructions through the use of the REXXTRY.CMD program.
REXXTRY interactively interprets REXX instructions and
can be started from an OS/2 command prompt.
For more information about REXX and PMREXX, select REXX Information in the
Information folder.
- PRINT
-
Prints or cancels printing of one or more files.
|------------------|
|
--|---------|-|--------|--- PRINT -----|-------------|--|--~
|- drive -| |- path -| |- /D:device -|
|----- /B ----|
|----------------|
|
---|---------||--------|-- filename -|----|--|------|---|||
|- drive -||- path -| | | |- /C -| |
| | | |- /T -| |
|-----------------------------------| |- /D:device -|
Related Commands: ;)SPOOL
It is important to note that:
o The /C and /T parameters are valid for OS/2 sessions
only.
o The /C or /T parameter cannot be used with the /B
parameter.
o The /C and /T parameters cannot be used together.
o A file name cannot be specified with the /C or /T
parameter.
You can enter more than one file name (along with its appropriate parameters)
at the command prompt. The global file-name characters (* and ?) are allowed.
Also, the files are queued for printing in the order in which you enter them.
/D:device Specifies the print device. Default LPT1
/B Causes ^Z characters not to be interpreted as EOF
/C Cancels the currently printing file
/T Cancels all files waiting to be printed
- PROMPT
-
Changes the system command prompt.
PROMPT ---------------|----------------|-------------------|
|----- text -----|
Related Commands: ;)DATE ;)HELP ;)SET ;)TIME and ;)VER
Typing this command without a parameter resets the system prompt to the system
default. PROMPT can be specified with the SET command. You can also set the
PROMPT command in the CONFIG.SYS file.
In DOS sessions, the default system prompt is the default drive letter
followed by the > symbol. If you are in the root directory of the default
drive, your DOS command prompt looks like this:
C>
The default OS/2 system prompt is the current directory of the default drive
enclosed within bracket symbols. If you are in the \OS2 directory of the
default drive, your OS/2 command prompt looks like this:
[C:\OS2]
$ Dollar Sign character
t Current time(HH:MM:SS:hh)
d Current date
p Current directory of the default drive
v Version number
n Default drive
g Greater-than character (>)
l Less-than character (<)
b Bar (|) character
_ CR LF Sequence
h Backspace and delete the previous character
e ASCII code 1B (escape)
q Equal sign (=)
- PSTAT
-
Displays process, thread, system-semaphore, shared-memory, and dynamic-link
library information.
----|---------|----|--------|---- PSTAT -----|----------|--|
|- drive -| |- path -| |--- /C ---|
|--- /S ---|
|--- /L ---|
|--- /M ---|
|- /P:pid -|
Enter this command without a parameter to display information about the
following:
o Current processes and threads
o System semaphores
o Shared memory for each process
o Dynamic-link libraries
PSTAT displays process status information, such as current processes and
threads, system semaphores, dynamic-link libraries, and shared memory. PSTAT
helps you determine which threads are running in the system, along with their
current status and current priorities.
This command also aids you in determining why a given thread is blocked
(waiting for a system event), or why the thread's performance is slow (low
priority compared to other threads.) Moreover, it displays the process ID
that has been assigned from each process. The process ID can then be used as
input to the TRACE utility program for tracing on a per-process basis.
/S System Semaphore Information
/C Current Process and Thread Info
/L Dynamic Link Libraries
/M Shared memory segments
/P:pid
- RECOVER
-
Recovers files from a disk that contains defective sectors.
---|---------|-|--------|------------ RECOVER -------------~
|- drive -| |- path -|
--|-------------------------------------------|-----------|
|--|---------|---- path ------ filename ----|
| |- drive -| |
| |
|--|---------|--|--------|---- filename ----|
|- drive -| |- path -|
Related Commands: ;)CHKDSK
OS/2 2.0 reads the specified disk, sector by sector. If RECOVER finds a bad
portion, the sector is marked and data is no longer allocated to it. All the
files on the disk can be recovered if the directory has been damaged.
RECOVER cannot recover files on the disk that contains the RECOVER.EXE file or
the disk used to start the OS/2 operating system. RECOVER locks the drive to
be recovered so that no other applications or processes are allowed to access
the drive.
The OS/2 message file, C:\OS2\SYSTEM\OSO001.MSG, must not be on the disk to be
recovered. To be sure it is not, do the following:
o Copy the following files to a blank, formatted diskette;
C:\OS2\RECOVER.COM, C:\OS2\SYSTEM\OSO001.MSG
o Delete these files from the disk to be recovered.
o Start the system from the OS/2 Install Diskette.
o At the A: prompt, type:
SETDPATH=A:\
SETPATH=A:\
o Put the diskette prepared earlier into drive A and type:
RECOVER C:filenames
RECOVER does not work on drives that have an ASSIGN, JOIN, or SUBST command in
effect. Also, RECOVER does not work on network drives.
Note: Use RECOVER with a specific file name or group of file names to
ensure that only the specified files are recovered and that other files on the
target disk will maintain their integrity.
Extended Attributes: RECOVER will attempt to recover the clusters that
contain the extended attributes of a file. An extended attribute is a special
area used for storing data that describes the file to the system or to an
application. If errors occur in any extended attribute chain, RECOVER writes
extended attribute information into a file that follows this naming format:
EAnnnn.REC (nnnn is a sequential number starting with 0000). The data from
any bad sector appears in the file as zeroes; the original recovered file no
longer contains extended attributes. RECOVER also recovers the file or
directory associated with the extended attribute chain and places it in a file
that follows this naming format: FILEnnnn.REC. The number in this file name
corresponds to the number shown in the EAnnnn.REC file name.
When recovering files or directories that have extended attributes, be sure to
use OS/2 2.0 to ensure all extended file attributes are recovered.
When using RECOVER on a disk formatted for the High Performance File System
(HPFS), it is important to note the following:
o RECOVER does not recover an entire disk; only individual
files are recovered.
o RECOVER uses the original file name. If the old file
cannot be recovered, RECOVER creates a file that follows
this naming format: FILEnnnn.REC and places that file in
the same directory as the original file.
o If a sector in the damaged file cannot be recovered,
RECOVER fills the area occupied by the sector with zeroes
in the new file, preserving the original file size.
Return Codes:
0 - Normal completion
1 - Undefined
2 - Undefined
3 - Ended by user
4 - Ended due to error
5 - Unable to read or write to one of the file allocation
tables
6 - Unable to execute another file system's recover
program
- RENAME or REN
-
Changes a file name or extension without changing the contents of the file.
You can use RENAME or REN interchangeably. In OS/2 sessions, you can also
change the name of a directory.
RENAME -|-|---------|-|--------|-- filename1 -- filename2 -|
| |- drive -| |- path -|
REN ----|
Related Commands: ;)COPY ;)MOVE
You cannot specify a drive and path in the second file name; therefore, the
file stays in the same directory after you rename it.
You can use global file name characters (* or ?) in either file name. All
files matching the first file name are renamed. If global file-name
characters appear in the second file name, the corresponding character
positions are not changed.
- REPLACE
-
Selectively replaces files on the target drive with files of the same name
from the source drive. Also, it selectively adds files from the source drive
to the target drive.
--|---------|-|--------|--- REPLACE ---|----------------|--~
|- drive -| |- path -| |- source drive -|
-|--------|---- filename --- target drive ---|--------|---~
|- path -| |- path -|
|--------------------------|
|
-------|---------------------|--|-------------------------|
|-----|-- /A --|------|
| |-- /S --| |
|-------- /P ---------|
|-------- /R ---------|
|-------- /W ---------|
|-------- /U ---------|
|-------- /F ---------|
Hidden and system files are not found on the source and are not replaced on
the target. Also, if you use the /A parameter with the /S parameter, the
system displays an error message.
Extended Attributes: REPLACE will copy the source file's extended attributes
to the target file (See the /F parameter). When replacing files that have
extended attributes, be sure to use OS/2 2.0 to ensure all extended file
attributes are replaced.
Return Codes:
0 - Normal completion
1 - No files were found to replace
2 - Some files not replaced (or added) due to file errors
4 - Ended due to error
Switches:
/A Append switch is used to append files to an existing
directory. All files existing on the source that do not
exist on the target are written to the target directory.
The append feature only works when writing files within
a single directory.
/D Date switch is used to replace the target file(s) having
dates and times less current than the source files. This
switch cannot be used with the /A switch.
/P Prompt switch is used to allow the user to determine
which target files are replaced or which source files are
to be added on a per file basis.
/R Read-only switch is used to replace read-only files, as
well as any designated, unprotected files. If you
attempt to replace a read-only file without using the /R
switch, REPLACE will terminate with an error. The read-
only attribute of the file is not changed by using this
command.
/S Subdirectory switch is used to search all subdirectories
on the target directory for the targeted files that are
to be replaced. The paths of the source and target files
do not have to match when you use this switch. This
switch cannot be used with the /A switch. REPLACE never
searches the source subdirectories.
/W Wait switch allows diskettes to be swapped before the
actual processing begins.
Return Codes: For 1.3 and below
0 Normal completion
1 ^C abort, or user answered A to an "Abort, Retry, Ignore"
prompt
2 File not found
3 Path not found
5 Access Denied
8 Insufficient Memory
11 Command line error (invalid parameter, number of
parameters, incompatible parameters, switches)
15 Invalid Drive
22 Invalid Operating System Version
- RESTORE
-
Restores one or more backed-up files from one disk to another.
---|---------|--|--------|--- RESTORE --- source drive ---~
|- drive -| |- path -|
--|----------------|----|--------|----|------------|------|
|- target drive -| |- path -| |- filename -|
|--------------------------|
|
. . . . . .--------------|-------- /P --------|-|-------------------|
|-------- /M ---------|
|---- /B:mm-dd-yy ----|
|---- /A:mm-dd-yy ----|
|---- /E:hh:mm:ss ----|
|---- /L:hh:mm:ss ----|
|-------- /S ---------|
|-------- /N ---------|
|-------- /F ---------|
|-------- /D ---------|
Related Commands: ;)ATTRIB ;)BACKUP
You must have used the BACKUP command to place the files you want restored on
the source. Note that:
o RESTORE works only within the source directory unless you specify the /S
parameter, which copies files in the source directory and in all directories
below the starting source directory.
o When RESTORE prompts you to insert the source diskette, make sure that you
insert the correct backup diskette. When you restore all your files, RESTORE
prompts you to insert the backup diskettes in order.
o RESTORE can restore files from disks of different types.
o The RESTORE command does not restore COMMAND.COM, CMD.EXE, or the hidden
OS/2 and DOS system files on the root directory. Therefore, you cannot use
RESTORE to create a startable disk or diskette.
o You must restore files to the same directory they were in when BACKUP copied
them. If you try to restore them to a different directory, the system
displays an error message.
o If you use global file-name characters, RESTORE prompts you to insert the
next diskette after it has restored all files on the backup diskette that
match the specified file name.
o If you are sharing files, you can restore only files that you have access
to. If you attempt to access a file that you do not have access to, the
system displays an error message.
Extended Attributes: RESTORE will copy the extended attributes of a backed-up
source file or directory to the target (See the /F parameter). An extended
attribute is a special area used for storing data that describes the file to
the system or to an application.
When restoring files that have extended attributes, be sure to use OS/2 2.0 to
ensure all extended file and directory attributes are restored. Extended
attributes of a backed-up source subdirectory will only be copied to the
target when the subdirectory does not already exist on the target.
Return Codes:
0 - Normal completion
1 - No files were found to restore
2 - Some files were not processed due to file errors
3 - Ended by user
4 - Ended due to error
Switches:
/S Restores all matching files from the specified directory
and all subdirectories below the specified directory in
the TREE structure. If you do not use the /S option,
RESTORE copies only the files in the specified directory.
/P Prompts before restoring read-only files or files that
have been modified since the last backup.
/B:date Restores all files that were modified on or before
the specified date. The format you use for date
depends on the country code selected.
/A:date Restores all files that were modified on or after
the specified date. The format you use for date
depends on the country code selected.
/M Restores all files modified or deleted since they were
last backed up.
/N Restores all files that no longer exist on the target
disk.
Note: You cannot specify /B, /A, /M, or /N on the same
command line.
/L:time Restores all files modified at or after the time
specified by time.
/E:time Restores all files modified at or before the time
specified by time.
- RMDIR or RD
-
Removes empty directories from a multilevel directory structure.
RMDIR ----|---------|---------|-------|--------|----|-----|
RD --| |- drive -| |- path -| |
| |
|------------------------------------|
Related Commands: ;)CD ;)DIR ;)MD and ;)TREE
You cannot remove the root directory or the current directory. You also
cannot remove a subdirectory of the current directory.
To process this command, it is important that you:
o Empty the directory of all files by using DEL or ERASE
before using the RD or RMDIR command. Only the two
special hidden files of (.) and (..) remain.
o Empty the directory of all files in each subdirectory, if
the directory contains subdirectories.
o Remove all hidden file attributes from all files except
(.) and (..).
You cannot use this command on drives that have a SUBST or JOIN command in
effect.
- SET
-
Sets one string in the environment equal to another string for later use in
programs. You can use the SET command in your CONFIG.SYS file or batch files
to set search paths and environment variables.
To use SET from the command prompt:
SET ----|------------------------------------------------|-|
|- string= -|--------------------|---------------|
|-------- string ----|
To use SET in your CONFIG.SYS file:
SET ---------- string --------- = --------- string ---------|
Related Commands: ;)APPEND ;)DPATH ;)KEYS ;)PATH and
;)PROMPT
Enter this command without a parameter to display the environment variables
for the current mode of operation.
If the name specified by the first string of the SET command already exists in
the environment, the command processor replaces its current value with the new
value specified by the second string. If you enter the SET command with only
the first string and the equals sign (=), the command processor removes the
environment variable or replaceable parameter name and its associated value
from the environment, if the name exists.
The environment is a special place in storage that is used by the command
processor to store and look up information, such as the values assigned to
names. You can use SET to create a replaceable parameter or to set the value
of a system variable, such as PATH. Application programs (particularly
compilers and assemblers) and batch files can use the information stored in
the environment to affect their processing.
Because DOS sessions and OS/2 sessions operate independently, each command
processor that starts a session can have its own environment. For information
on how command processors within a session inherit the environment, refer to
the COMMAND.COM and CMD.EXE command processors.
You can use the SET command in a batch file to define a replaceable parameter
that will be replaced by values supplied when the batch file runs. In OS/2
sessions, replaceable parameters can also be set on the command line. You
must begin and end the name with a percent sign (%). For example, suppose you
have a batch file that contains multiple occurrences of a file name. To avoid
having to change each occurrence when you want to change the name of the file,
you can specify the file name as a replaceable parameter; for example:
%MYFILE%
To set %MYFILE% to a specific file name, include a SET command in your batch
file:
SET MYFILE=SAMPLE.ABC
After the batch processor interprets the SET command, it changes each
occurrence of %MYFILE% it meets in the batch file to SAMPLE.ABC.
You can also use names of system variables as replaceable parameters in batch
files. Assume that you have the following replaceable parameter in a batch
file:
%PATH%
When the batch processor meets this replaceable parameter, it looks in the
environment for the current value of PATH and substitutes that value.
You can use the SET command to set the value of OS/2 system variables. These
system variables for OS/2 sessions are:
PATH Sets a search path for executable files.
DPATH Sets a search path for data files.
KEYS Permits previously issued commands to be retrieved
and edited.
PROMPT Sets a new command prompt.
The system variables for DOS sessions are:
PATH Sets a search path for executable files.
PROMPT Sets a new command prompt.
APPEND Sets the search path for data files if the APPEND
command is entered with the /E option.
The command processor recognizes system variable commands that are entered at
the command prompt. You can also enter the system variables with the SET
command. While the SET command is optional at the command prompt, it is
required when used to set system variables in the CONFIG.SYS file.
In OS/2 sessions, substitution of replaceable parameter names by their values
in the environment can be made at the command prompt. Using this feature of
OS/2 2.0, you can append values to the values of system variables already in
the environment. For example, assume that your current path to data files is:
DPATH
C:\OS2;C:\OS2\SYSTEM;
C:\OS2\INSTALL;
To append a path to the \MYDIR directory on drive C, enter:
SET DPATH=%DPATH%;C:\MYDIR;
Or you can enter:
DPATH %DPATH%;C:\MYDIR;
In both these examples, the C:\MYDIR directory is appended to the current path
to data files in the environment of the current OS/2 session. In this
example, assume that your current path ends with a semicolon. If no
environment variable exists by the name you specify, no substitution is made.
The system will not generate a message stating that the substitution was not
made.
The following is the contents of the batch file ADDPATH.BAT or ADDPATH.CMD.
It will append the first parameter to the end of the current path setting:
@PATH=%PATH%%1;
- SETBOOT
-
Provides the ability to set up the Boot Manager for a hard disk.
------|-------|-|------|- SETBOOT -|-----------|--|
| drive | | path | |-- /T:x ---|
|-- /T:NO --|
|-- /M:m ---|
|---/Q -----|
|---/B -----|
|-- /X:x ---|
|- /N:name -|
Related Commands: ;)FDISK
Related Information: Hard Disk Information
The SETBOOT utility program helps you to set up the Boot Manager. It allows
you to enter parameters at the command prompt that enable you to take full
advantage of the Boot Manager. Type the following command to use the SETBOOT
parameters:
SETBOOT /option:parameters
- SETCOM40
-
Only used with OS/2 1.xx.
Sets the address of the specified serial port so that a DOS application can
find the port and use it. Use this command if you installed COM0n.SYS with
the DEVICE command in your CONFIG.SYS file. IF you have not installed the
driver, you do not need to run SETCOM40.
SETCOM40 COMn=ON|OFF
n This variable represents the number of the serial port
whose address you want to set.
ON This switch sets the address of the serial port in
memory.
OFF This switch removes the address of the serial port from
memory.
Note: Versions 1.xx Only.
- SHARE
-
Only used with OS/2 1.xx.
SHARE /F:filespace /L:locks
/F Filespace parameter allocates file space (in bytes) to an
internal pool (buffer) were DOS records filesharing
information. For each open file, you need space to equal
the length of the full filename plus 11 bytes. (The
average pathname is 20 bytes.) The default is 2 Kbytes.
/L Locks parameter sets the number of locks. The default is
20.
- SORT
-
Reads data from standard input, sorts the data, and writes it to standard
output.
--|---------|-|--------|-- SORT ---|------|----|-------|---|
|- drive -| |- path -| |- /R -| |- /+n -|
Related Commands: ;)CODEPAGE ;)COUNTRY
It is important to remember that:
o When you are sorting large files, you might have to wait
a few minutes until processing is completed. The maximum
size of a file you can sort is approximately 63KB, or 64
512 bytes.
o The standard input and output devices cannot be
redirected to the same file name.
o Characters are sorted according to their ASCII values,
with the following exceptions: lowercase letters (a - z)
are equated to uppercase letters (A - Z), and characters
above ASCII value 127 are sorted according to rules based
on the currently selected country code.
Note that the word sort means to rearrange lines of text according to specific
instructions. Use SORT if you want to arrange a file in alphabetic or numeric
sequence. For example, you could use SORT to alphabetize applicant names or
number a schedule according to dates.
Return Codes: SORT issues a return code of 0 for normal completion.
Switches:
/R Sort in reverse order
/+n Sort starting in column n
- SPOOL
-
Redirects printer output from one device to another, for example, from one
parallel printer to another, or from a parallel printer to a serial printer.
|---------------|
|
--|---------|-|--------|---- SPOOL ---|-|-------------|||---|
|- drive -| |- path -| | |- /D:device -| |
| |- /O:device -| |
|------- /Q ------|
Related Commands: ;)DEVICE ;)CODEPAGE ;)DEVINFO and ;)PRINT
The Base Asynchronous Communications device driver supports COM1 through COM4.
For the system to spool to a serial printer, it must load the COM.SYS device
driver during system initialization. This requires a DEVICE statement in your
CONFIG.SYS file.
When spooling to a serial printer, you may need to issue the MODE command so
that the Asynchronous Device Driver works correctly with the serially attached
printer. The communications setting used by the Asynchronous Device Driver
must match the setting used by the serially attached printer. Serial settings
include such items as the baud rate, the parity, the start and stop bits, and
the hardware or software handshaking. You only need to issue the MODE command
if the Presentation Manager* printer driver installed in the spooler does not
use the Communication Ports settings. The MODE command can be issued before
or after starting SPOOL.
The recommended way is to change the communications settings using the Port
settings window. If you change the communications settings using the MODE
command and Port settings window, the settings in the window will override the
settings set by the MODE command.
You can use one of the following two methods for starting the spooler:
o Activate the spooler by selecting Print from the menu of
the object that you want to print to display the Spooler
window.
o Enter the SPOOL command with no parameters at the OS/2
command prompt.
For non-Presentation Manager* (PM) applications and PM applications that use
non-PM printing, the spooler supports spooling of data only to parallel
devices (PRN, LPT1, LPT2, and LPT3) as input devices.
Output devices, on the other hand, can be parallel devices and serial devices
COM1, COM2, COM3, and COM4.
Note: Be sure you have the appropriate DEVICE= statement in the
CONFIG.SYS file if you plan to use a serial device.
Proprinter setup information
Name PRINTER1
Description Parallel printer
Device LPT1
Driver IBM4201
Queue LPT1Q
Quickwriter setup information
Name COM1PRTR
Description Serial printer
Device COM1
Driver IBM5202
Queue COM1Q
Printer redirection setup information
Name REDIRECT
Description Redirection of output
Device LPT2
Driver (None specified)
Queue (None specified)
Using the SPOOL command, you can redirect parallel printer output to a serial
device by specifying a parallel printer as the input device (/D) and a serial
printer as the output device (/O).
To redirect input from a parallel port to the printer attached to a serial
port (for example, COM1), enter the following:
SPOOL /D:LPT2 /O:COM1
To print a file named LETTER on the serial printer you just set up, enter the
following:
PRINT LETTER /D:LPT2
To cancel the redirection specified in the previous SPOOL statement, enter the
following:
SPOOL /D:LPT2 /O:LPT2
If you have set up the spooler for print spooling, it is possible your print
job could print on another physical device. The reason for this is that the
queue processor sends the highest priority print job to the next available
printer (not currently printing). For example, if you specify the input
device /D:LPT1 and specify the output device /O:LPT2, the output will go into
a queue for the LPT2 device, but because of the multiple output devices, the
data might print on an LPT3 device. If you associate one queue with LPT2, you
are guaranteed to have all output print on the port you specified.
Note that if there is a DEVINFO statement for your printer and the print
spooler is active for the printer, all non-PM or base printing output on that
printer defaults to the printer's character set. Using Character Set 2 is
necessary to support printing in either of the two OS/2 code pages specified
with the CODEPAGE statement in CONFIG.SYS. Character Set 1 can still be
accessed using escape sequences. Refer to the instructions that came with
your printer.
The print spooler also supports any other character device whose device driver
contains monitor support that is compatible with the printer device driver.
This means that any printer device driver that removes the base printer device
driver from operation and has the same monitor support as the base printer
device driver can also support the Presentation Manager spooler.
The print spooler spools output from a program into a file until it is
instructed to close the file and print its contents. Many DOS programs do not
contain the instructions required by the print spooler, so output is not
printed until the application program ends.
If you wish to force printer output for a DOS program, you can do so while you
are still interacting with the program by pressing the Ctrl, Alt, and PrtSc
keys together. This causes the temporary spool file to be closed and prepared
to print. Make sure that you wait until the entire file has been sent to the
queue by your application program. Pressing the Ctrl, Alt, and PrtSc keys too
soon can cause the print file to split into two separate print files.
Another method to force printer output for a DOS application is to set the DOS
Settings printer option with the following procedure:
1. Select Settings from the menu of a DOS session.
2. Select the Session tab.
3. Select the DOS settings pushbutton.
4. Select timeout for printing in the DOS Settings window.
5. Specify the number of seconds to wait after the DOS
application completes printing before the spooler closes
the file and begins printing.
Setting the number of seconds too small can cause the print file to be split
into two separate print files. This behavior can vary depending on the DOS
application that is running. Many applications print correctly with a small
delay. The printer timeout is set only for applications running in the window
in which the option was set.
If you plan to use code-page switching for DOS sessions, you must start the
print spooler before selecting a DOS command prompt from the Command Prompts
folder.
If you are using code-page switching on the IBM Quietwriter III printer, you
must make sure that the correct cartridge is in its slot. When the correct
cartridge is not in the slot, the printer "beeps," and the font light comes
on. You must:
1. Insert the correct cartridge.
2. Press the Start button after the font light goes off.
- START
-
Starts an OS/2 program in another session.
The primary use for START is to automatically start programs at system
startup. The special batch file, STARTUP.CMD, allows you to do this.
To imbed redirectional signals into the command session, enclose the command
and command inputs in quotation marks.
START --|-----------|------|--------|------|--------|-------
| "program | |-- /K --| |-- /F --|
|- title" -| |-- /C --| |-- /B --|
|-- /N --|
. . . . . --------|--------|--------|--------|------|--------|-------|
|- /PGM -| |- /FS -| |- /MAX -|
|- /WIN -| |- /MIN -|
|- /PM -|
|- /DOS -|
---------|------|--------- command ---|-------------|------|
|- /I -| | command |
|-- inputs --|
Related Commands: ;)RUN
Enter this command without a parameter to start an OS/2 command processor.
If you use the /WIN, /FS, or /PM parameter, your program runs in the
foreground session. If you do not use one of these parameters, you can use
the /F parameter to make the program run in the foreground session.
Make sure that you specify the correct drive and path when you use the START
command to run a batch file with the STARTUP.CMD file. Also, if you plan to
redirect I/O using the START command, enclose the command and command inputs
within quotation marks.
You can use START to run full-screen applications or applications running in a
window such as Presentation Manager* programs.
START determines the type of application and will run it in the appropriate
window or full-screen session. However, you have the option to override the
determined default by using the /FS, /WIN, /PM, or /I parameter.
You cannot start a batch file (.CMD) with the /PM parameter.
Switches:
/K This parameter tells the command processor to run the
command you specify and then keep the session open when
the command is completed.
/C This parameter tells the command processor to carry out
command and then end the session and return to the
program from which it was started.
/N This parameter tells OS/2 to run command without starting
the command processor.
/F This parameter tells OS/2 to run the command in the
foreground.
/FS This parameter tells OS/2 to run the command as a full-
screen application in the foreground, in a session
independent of the Presentation Manager.
/WIN This parameter tells OS/2 to run the command in a
Presentation Manager window.
/PM This parameter tells OS/2 to run the command as a
Presentation Manager application. Options /K or /C
cannot be specified.
/I This parameter tells START to use the environment set in
your CONFIG.SYS file.
- SUBST
-
Substitutes a drive letter for another drive and path so that you can access
that drive and path using only the drive letter. When OS/2 2.0 finds a drive
that was created with the SUBST command, it replaces the reference with the
new path.
--|---------|-------|--------|--------- SUBST -------------~
|- drive -| |- path -|
-----|----------------------------|-----------------------|
|-- drive --|-- drive\path --|
|------ /D ------|
Related Commands: ;)ASSIGN and ;)JOIN
Enter this command without a parameter to display the names of the
substitutions currently in effect on your system.
The following commands do not work in DOS sessions on drives that have a SUBST
command in effect: BACKUP, CHKDSK, DISKCOMP, DISKCOPY, FORMAT, LABEL,
RECOVER, and RESTORE.
Substitutes a drive letter for another drive and path so that you can access
that drive and path using only the drive letter. When OS/2 2.0 finds a drive
that was created with the SUBST command, it replaces the reference with the
new path.
--|---------|-------|--------|--------- SUBST -------------~
|- drive -| |- path -|
-----|----------------------------|-----------------------|
|-- drive --|-- drive\path --|
|------ /D ------|
Related Commands: ;)ASSIGN and ;)JOIN
Enter this command without a parameter to display the names of the
substitutions currently in effect on your system.
The following commands do not work in DOS sessions on drives that have a SUBST
command in effect: BACKUP, CHKDSK, DISKCOMP, DISKCOPY, FORMAT, LABEL,
RECOVER, and RESTORE.
Switches:
/D This switch removes the drive substitution.
Note: Without any parameters, DOS displays the current substitutions.
- SYSLEVEL
-
Displays operating-system service level
----|---------|----|--------|---------- SYSLEVEL ----------|
|- drive -| |- path -|
This utility program displays the corrective service level of the system.
The following message will appear while SYSLEVEL checks the current corrective
service level of your system
Please wait...
Once the corrective service level has been determined the following will be
displayed on your monitor.
C:\OS2\INSTALL\SYSLEVEL.OS2
IBM OS/2 Base Operating System
Standard Edition 2.00 Component ID 560109001
Current CSD level: XR00000
Prior CSD level: XR00000
An example of the information displayed and an explanation of the displayed
items follows:
o C:\OS2\INSTALL\SYSLEVEL.OS2
- The subdirectory and file containing the information.
o IBM OS/2 Base Operating System
- The system name.
o Standard Edition 2.00, Component ID:
- The edition and the version, release, modification
number, followed by the Component ID of the system.
o Current CSD Level: nnnnnnn
- The current corrective service level.
o Prior CSD Level: nnnnnnn
- The prior corrective service level.
- SYSLOG
-
Allows you to view or print the formatted contents of the system error-log
file.
SYSLOG -----|-----------------|------------------|
|------- /S ------|
|------- /R ------|
||- /P:pathname -||
|----- /W:x ----|
Related Commands: DEVICE ( ;)LOG.SYS ), ;)RUN (LOGGING)
You can enter this command with parameters to do the following:
o Suspend system error logging
o Resume system error logging
o Redirect error logging data from one file to another.
o Specify the size of an error-log file.
If you enter the SYSLOG command with no parameters, the SYSLOG utility program
is started.
SYSLOG is a Presentation Manager* application that runs in a window. You can
use SYSLOG to suspend or resume error logging, format the contents of
error-log files, print the contents of those log files, or redirect error
logging to a different file.
- TIME
-
Displays or changes the time known to the system and resets the time on your
computer's clock. This time is recorded in the directory when you create or
change a file.
TIME --|--------------------------------------|------------|
|- hh -|-------------------------------|
|- :mm -|-----------------------|
|- :ss -----------------|
Related Commands: ;)COUNTRY ;)DATE and ;)PROMPT
Enter this command without a parameter to display the system time and be
prompted about changing it.
Specify time in hours and minutes, using a 24-hour clock (military time),
separated by a colon or period. You can also add the seconds and hundredths
of a second separated by a period or a comma, depending on the decimal
separator shown on your screen.
Note: If you do not enter a valid time, the system displays an error
message. Also, as with the DATE command format, you can change the TIME
separators by editing the COUNTRY statement in your CONFIG.SYS file.
- TRACE
-
Selects or sets the tracing of system events.
This command is intended to be used with the assistance of your technical
coordinator.
---|---------|-|--------|------- TRACE ------|- OFF -|-----~
|- drive -| |- path -| |- ON -|
--|-----------------------|----|--|----------|---|--------|
||-- major_code_spec --|| | |--- /S ---| |
||- (minor_code_spec) -|| | |--- /R ---| |
||----- tdf_spec ------|| |------ /C -------|
||- (minor_code_spec) -||
||- (event_type_spec) -||
||--- tdf_keyword -----||
||- (minor_code_spec) -||
||- (event_type_spec) -||
|--|------ /P: -----|---|
|--- pid_spec ---|
To allow system trace in your CONFIG.SYS file:
TRACE = ---------|- OFF -|-------------|-----|-----|-------|
|- ON -| |- x -| |
| |
|------- , -------|
Related Commands: ;)PSTAT ;)TRACEBUF and ;)TRACEFMT
Related Information: Trace Point Overview and Trace Definition Files (TDF)
The OS/2* operating system processes TRACE statements in the order in which
they appear in the CONFIG.SYS file; the effects of the statements are
cumulative. If any part of a statement is incorrect, the OS/2 operating
system ignores the statement.
If you do not specify TRACE in the CONFIG.SYS file, events are not traced.
However, if you have a TRACEBUF statement in CONFIG.SYS, this allocates a
trace buffer. Then, you can trace events by entering the TRACE command at the
OS/2 command prompt.
If TRACE=OFF or TRACE=ON appears in the CONFIG.SYS file without a TRACEBUF
statement, the system allocates a 4KB trace buffer.
If you do not specify TRACE or TRACEBUF statements in the CONFIG.SYS file,
OS/2 2.0 does not allocate a trace buffer and system tracing is not available.
The System Trace facility is used to record a sequence of system events,
function calls, or data. The record is usually produced for debugging
purposes. After the trace data is recorded, the System Trace Formatter is
used to retrieve it from the system trace buffer and format the data to your
display, printer, or file.
On request, the OS/2 operating system tracing facility records certain
important events in the system and system extensions in a circular buffer.
If a system problem can be duplicated without a system failure, the TRACE OFF
function allows tracing to be stopped after the problem has been re-created.
This allows the state of the trace buffer to be preserved from the time the
TRACE OFF command is processed.
The tracing mechanism is performance critical; therefore, no statistical
processing of recorded data is performed by the tracing routines.
Records in the buffer are identified by major and minor codes (you can only
specify TRACE by major code in the CONFIG.SYS file). Some of the data that
may be recorded in the circular buffer will include system events such as
interrupts and task switches.
If you need to use the System Trace facility, your technical coordinator will
provide the buffer size. When the trace is complete, you can use the trace
formatter (TRACEFMT) to organize the data into a report. This helps you
isolate causes of problems in the OS/2 system by formatting the information
placed in the trace buffer by the Trace facility.
An OS/2 enhancement to the Trace utility program allows you to trace a given
process or set of processes, so that you can focus on the events of the
specified process without intermixing events from other processes in the
system. This reduces the possibility of trace-buffer overflow by minimizing
the number of events which are recorded. Analyzing the formatted trace data
is quicker and easier because only events of the specified process are
recorded and displayed.
- TRACEBUF
-
Sets the size of the trace buffer. This statement is intended to be used with
the assistance of your technical coordinator.
TRACEBUF= --------------------- x --------------------------|
Related Commands: ;)TRACE and ;)TRACEFMT
TRACEBUF sets the size of the trace buffer in the CONFIG.SYS file. If any
valid TRACE statements are in CONFIG.SYS (including TRACE=OFF), the default
size of the trace buffer is 4KB.
The x parameter specifies a trace buffer size of up to 63KB. If you have a
TRACEBUF statement without a TRACE statement in the CONFIG.SYS file, the trace
buffer size requested is specified and tracing is turned off (the same as if
you specify TRACE=OFF). If you need to use the System Trace facility, your
technical coordinator will provide the buffer size.
If you do not specify a TRACE or TRACEBUF statement in CONFIG.SYS file, OS/2
2.0 does not allocate a trace buffer, and system tracing is not available.
- TRACEFMT
-
Displays formatted trace records in reverse time-stamp order. This command is
intended to be used with the assistance of your service coordinator. Your
technical coordinator will analyze the formatted data to help diagnose your
problem.
---|---------|-|--------|--------------- TRACEFMT ---------|
|- drive -| |- path -|
Related Commands: ;)TRACE and ;)TRACEBUF
TRACEFMT works only if you have the TRACE or the TRACEBUF statement in your
CONFIG.SYS file.
You use the TRACEFMT utility program to format the information placed in the
trace buffer by system trace. TRACEFMT is a Presentation Manager* application
running in a window. The TRACEFMT application provides choices on the menu
bar. From these choices, you can select items that allow you to do the
following tasks:
o Open a file
o Get system trace buffer
o Save As
- Save unformatted trace data
- Save formatted trace data
- Save either summary mode (process ID or major code)
o Print
- Formatted data
- Either summary mode
o View formatted data
o View summary by process ID
o View summary by major code.
Your technical coordinator will analyze the formatted data to help diagnose
your problem. You can use TRACEFMT as many times as required to diagnose a
problem without having to restart the system.
- TREE
-
Displays all the directory paths found on the specified drive, and optionally
lists the files in the root directory and in each subdirectory.
--|---------|-|--------|--- TREE ---|---------|-|------|---|
|- drive -| |- path -| |- drive -| |- /F -|
Related Commands: ;)CHDIR ;)DIR ;)MKDIR and ;)RMDIR
Enter this command without a parameter to display all directory paths found on
the current drive.
You can also:
o Print a directory listing on a printer
o Pause a directory listing on a display
The display (or output) indents at each subdirectory level and uses block
graphics.
Return Codes: TREE issues a return code of 0 for normal completion.
Switches:
/F This switch displays the names of the files in each
directory and subdirectory on the disk.
- TYPE
-
Displays the contents of one or more files on the screen. In a DOS session,
only one file is displayed.
TYPE -----------|---------|---|--------|---- filename --|--|
|- drive -| |- path -| |
| |
|--------------------------------------------|
You can also:
o Print a file
o Pause the display screen while viewing a file
You can use TYPE to display ASCII files. Text files appear in a legible
format; however, other files, such as object program files, may appear
unreadable because of the presence of nonalphabetic or nonnumeric characters.
Note that the data is unformatted except that tab characters are expanded to
an eight-character boundary (that is, columns 1, 9, 17, 25 and so on). In an
OS/2 session, TYPE displays files consecutively on the screen if you specify
multiple file names. You can include a drive and path when specifying
multiple file names and can also use the global file-name characters * and ?
in the file name you specify.
In an OS/2 session if multiple files or files with global characters are
listed, TYPE precedes the file data with the file name. A blank line appears
before and after each file name. TYPE writes the file data to Standard Output
and writes the file name to Standard Error. For example, to display data in
files named FILE1, FILE2, and FILE3 and place the file names in a file named
FILE.LST, enter the following:
TYPE FILE1 FILE2 FILE3 2> FILE.LST
To display the file names on the screen and place all the file data in a file
named FILE.TXT, enter the following:
TYPE FILE1 FILE2 FILE3 > FILE.TXT
Note: If you TYPE a text file that is not in the current directory, the
operating system searches the directories in the order that is specified in
your PATH statement,then in your DPATH statement.
- UNDELETE
-
Recovers files that have been deleted or erased.
UNDELETE |---------|-|--------|---|-----------|-----------------~
|- drive -| |- path -| |-filename -|
|-------------------|
|
--------|--|------|--|---|--------------------------------|
| |- /L -| |
| |- /S -| |
|---- /A ----|
|---- /F ----|
The UNDELETE command provides the capability of recovering files that have
been deleted or erased. UNDELETE is designed to delay the removal of a file,
which lets you retrieve a file before it is permanently discarded.
A new environment variable DELDIR defines the path and maximum size of the
directories used to store deleted files. One such directory is specified for
each logical drive on the system. The DELDIR statement is written in the
CONFIG.SYS file as follows:
SET DELDIR = drive:\path, maxsize; drive2:\path, maxsize
The path and maximum size values for each logical drive are separated from
each other by a comma; the logical drive names are separated by a semicolon.
When the DEL or ERASE command is issued from any session type, the file is
copied to the directory specified in the DELDIR statement for that logical
drive.
If the number of deleted files exceeds the maximum size of the specified
directory, files are automatically removed from the directory to conform to
its maximum size specified in the DELDIR statement. Files are removed in
first-in-first-out (FIFO) order. To disable storage of deleted files in a
directory, remove the directory name from the DELDIR statement.
When UNDELETE is specified, if the file is still recoverable, it is reclaimed
and restored to its specific path. If a duplicate file name exists, you are
prompted to rename it or it is ignored by the system.
UNDELETE can be used in both DOS and OS/2 sessions. Files that are available
for recovery are reported as used bytes on the disk.
- UNPACK
-
Unpacks (decompresses) compressed files and copies files that are not
compressed but are located on the OS/2 installation diskettes. Compressed
files have a @ as the last character in their file name.
--|---------||--------|- UNPACK -|---------||--------|- filename --~
|- drive -||- path -| |- drive -||- path -|
-|---------||--------|----|------||------||---------------|-------|
|- drive -||- path -| |- /V -||- /F -||- /N:filename -|
--|---------||--------|- UNPACK -|---------||--------|- filename --~
|- drive -||- path -| |- drive -||- path -|
-----------------------|---------|--------------------------------|
|- /SHOW -|
Do not specify an output file name; UNPACK uses the file name from the
original uncompressed file as the destination file name. It also preserves
the date, time, and file attribute of the original uncompressed file.
UNPACK copies files that are not compressed and handles file information such
as date, time, and file attributes in the same way the COPY command does.
Therefore, you can unpack a diskette that contains a combination of compressed
and uncompressed files.
Return Codes:
0 - Normal completion
1 - No files were found to unpack or copy
2 - Some files or directories were not unpacked or copied
due to file errors
3 - Ended by user
4 - Ended due to error
Switches:
/V This switch verifies that the version level of UNPACK is
the same as that of OS/2.
- VER
-
Displays the OS/2 version number.
VER -------------------------------------------------------|
This command can be entered at either the OS/2 or DOS prompt. The OS/2
version number is displayed on your screen; for example:
The Operating System/2 Version is 2.00
- VERIFY
-
Confirms that data written to a disk has been written correctly.
VERIFY ----------------|-------|---------------------------|
|- ON -|
|- OFF -|
Enter this command without a parameter to display the current VERIFY status.
You can use the VERIFY command to tell the system to verify that files are
written correctly to the disk (for example, no bad sectors). The system does
a VERIFY action each time you write data to a disk. You receive an error
message only if the system is unable to write the data to the disk
successfully.
When you issue VERIFY ON, verification is done for file system I/O write
actions for both hard disks and diskettes on a per session basis.
This command has the same purpose as the /V parameter in the COPY and XCOPY
commands.
- VIEW
-
Displays online documents created with the Information Presentation Facility
(IPF) compiler. VIEW displays IPF files that have a .INF extension.
---|---------|-|--------|---------- VIEW -------------~
|- drive -| |- path -|
---|---------|-|--------|-- filename --|---------|----|
|- drive -| |- path -| |- topic -|
VIEW displays files that have been compiled by the IPF compiler as online
documents having a .INF extension. VIEW can display the entire file or
individual topics that are located in the Contents of the file.
- VMDISK
-
Creates a file that contains the image of a DOS startup diskette. After
creating an image, you can create a DOS session by starting from this image
file.
VMDISK -- sourcedrive --|---------------|-|--------|- filename -|
|- targetdrive -| |- path -|
Related Commands: ;)FSFILTER ;)FSACCESS
Related Information: Starting a Specific Version of DOS
To use VMDISK, you need to make changes to the DOS startup diskette. Select
Starting a Specific Version of DOS in the "Related Information" section above
for more information about preparing the DOS startup diskette.
- VOL
-
Displays the disk volume label and serial number if they exist. From a DOS
command prompt, VOL displays the label for only one disk. From an OS/2
command prompt, if you specify more than one drive, VOL displays the volume
labels consecutively.
VOL ---------------|---------|----------|------------------|
|- drive -| |
|-------------------------|
Related Commands: ;)FORMAT and ;)LABEL
Enter this command without a parameter to display the volume label and volume
serial number of the current drive.
- XCOPY
-
Selectively copies groups of files, which can include lower- level
subdirectories.
--|---------|-|--------|--- XCOPY -----|---------|---------
|- drive -| |- path -| |- drive -|
. . . . . . -|---- filename ----------|---|---------|---|--------|----
|- path ----|------------| |- drive -| |- path -|
|- filename -|
|--------------------------|
|
. . . . . .---- filename -------|---------------------|--|-----------|
|--- /D:mm-dd-yy ---|
|-------- /S ---------|
|-------- /E ---------|
|-------- /P ---------|
|-------- /V ---------|
|----|--- /A ----|----|
| |--- /M ----| |
|-------- /F ---------|
Related Commands: ;)BACKUP ;)COPY ;)RESTORE and ;)VERIFY
It is important to remember the following:
o Specify the drive, path, and file name for the source and
target drives. If you do not specify a path, XCOPY
starts from the current directory. If you do not specify
a file name, XCOPY uses *.* as the default value.
o XCOPY works only within the source directory unless you
specify the /S parameter, which copies files in the
source directory and in all directories below the
starting source directory.
o If you use the /D parameter, the month, date, and year
may be in different positions depending on your country.
o You cannot replace a read-only file with another file.
Also, you cannot use XCOPY to copy hidden or system
files.
o The /M parameter copies files whose archive bit is set,
and then turns off the archive bit of the source file.
You can use the ATTRIB command to reset the archive bit
for your files.
o If the specified target path does not exist on the
target, XCOPY creates the directories before copying.
You can rename files on the target by specifying a new
file name on the target.
Extended Attributes: XCOPY will copy the extended attributes of a source file
to the target file (See the /F parameter). An extended attribute is a special
area used for storing data that describes the file to the OS/2 operating
system or to an application.
When copying files that have extended attributes, be sure to use OS/2 2.0 to
ensure all extended file or directory attributes are copied. Extended
attributes associated with a source directory will be copied to the target if
the directory does not already exist on the target.
Return Codes:
0 - Normal completion
1 - No files were found to xcopy
2 - Some files or directories were not copied due to file
or directory errors
3 - Ended by user
4 - Ended due to error
Switches:
/D:mm-dd-yy Copies files that have been modified on or
after specified date
/S Copies Subdirectories
/E When used with /S this copies the entire tree structure
while creating corresponding source directories on the
target even if no files have been found on those source
directories.
/P Prompts you before performing a physical copy
/V Verifies that data written to a disk has been correctly
written
/A Copies archived files only. This parameter does not turn
off the archive bit of the source file.
/M Copies archived files only. Unlike /A, this parameter
turns off the archive bit of the source file.