# TIPS & TRICKS

TABLE OF CONTENTS

- WHERE TO FIND "HELP" ON OS/2
- ADDING COLOR TO YOUR OS/2 COMMAND PROMPTS (WINDOW AND FULL SCREEN)
- FORCE THE "DIR" COMMAND TO DISPLAY DIRECTORIES IN ALPHABETICAL ORDER, WITH THE SUBDIRECTORIES LISTED FIRST
- CHANGE THE APPEARANCE OF THE WARP CENTER CLOCK (for Warp 4.0)
- DISPLAY LIST OF ACTIVE PROCESSES (for Warp 4.0)
- AUTOMATIC MENUS FOR THE WARP CENTER (for Warp 4.0)
- MAINTAINING THE SORT ORDER IN A FOLDER
- MINIMIZING WINDOW TO THE DESKTOP OR VIEWER
- RECORD A STREAM OF CHARACTERS FOR THE ENHANCED EDITOR (EPM.EXE)
- ADD FREQUENTLY USED PROGRAMS TO THE MAIN SYSTEM MENU
- BASIC SAFETY BACKUP OF KEY FILES
- RESTORING THE DESKTOP
- UNDELETING FILES
- SIZING OS/2 WINDOWS DISPLAYING THE WARP CENTER CONCATENATING FILES
- DELETING OR EDITING "READ ONLY" FILES
- MOUSE BUTTON TAP TO COPY/PASTE TO/FROM OS/2 CLIPBOARD
- SOME USEFUL OS/2 COMMANDS
- START EDITORS FROM DOS SESSION
- ENHANCED DOS COMMANDS

WHERE TO FIND "HELP" ON OS/2

In addition to the volumes written on OS/2 (see the "Publications" section of OS/2 CONNECT, as well as the documentation accompanying the product), there is a lot of reference information available to you on-line:

1. First, learn to make active use of the F1 Help key. You can use this at any time. Essentially, there are two uses for it: to invoke Help for the active application, and; Help for a specific field entry. In both instances, a dialog box appears to assist the user.

2. Thanks to common design standards, all OS/2 applications have a standard Help action-bar-choice on the main action-bar (located to the right side of the bar) with the following pull-down-choices:

       HELP INDEX - providing a list of subjects to chose from.
       GENERAL HELP - explaining the purpose and function of the application.
       USING HELP - help for help.
       KEYS HELP - explains how the various keys are used.
       ABOUT - optional.  Normally used to display the author or vendor of the program.
       Other optional Help pull-down-choices may also be displayed.

3. The "Information" folder (normally located inside the "OS/2 System" folder) includes such things as a "Glossary of Terms" and the OS/2 "Tutorial." Note: This assumes that all of the OS/2 documentation was loaded at time of installation. If it hasn't, you can load the documentation by using the "Selective Install" program in the "System Setup" folder (normally located in the "OS/2 System" folder).

4. A "Master Help Index" is included containing a wide variety of OS/2 subjects in alphabetical order. Again, this depends on whether the OS/2 documentation was loaded as part of the installation process.

5. Help is also available at the command line. In an OS/2 Window or Full Screen, simply type: HELP (subject), and the computer will display pertinent instructions. Again, assuming documentation was loaded during installation.

ADDING COLOR TO YOUR OS/2 COMMAND PROMPTS (WINDOW AND FULL SCREEN)

If you have a color monitor, add the following statement to your CONFIG.SYS file:

    SET PROMPT=$e[31;40m$e[1m[$p]$e[0m

This will give you a more colorful command prompt (red).

For a green prompt, try:

    SET PROMPT=$e[32;40m$e[1m[$P]$e[0m

FORCE THE "DIR" COMMAND TO DISPLAY DIRECTORIES IN ALPHABETICAL ORDER, WITH THE SUBDIRECTORIES LISTED FIRST

Edit your CONFIG.SYS file so that:

    SET DIRCMD=/O:GN

CHANGE THE APPEARANCE OF THE WARP CENTER CLOCK (for Warp 4.0)

Edit your CONFIG.SYS file so that:

    SET SCUSEPRETTYCLOCK=ON

This produces an attractive clock (black background with green numbers).

DISPLAY LIST OF ACTIVE PROCESSES (for Warp 4.0)

Edit your CONFIG.SYS file so that:

    SET KILLFEATUREENABLED=ON

Reboot the computer, then press the CONTROL key and click on the Window List icon in the Warp Center using the left mouse-button. This will display all of the active processes and allows you to kill processes if you so desire.

AUTOMATIC MENUS FOR THE WARP CENTER (for Warp 4.0)

Add the following statement to your CONFIG.SYS file to enable automatic pull-down menus from the WarpCenter (a la Win95):

SET MENUSFOLLOWPOINTER=ON

Reboot the computer and you're ready.

MAINTAINING THE SORT ORDER IN A FOLDER

Tired of re-arranging the icons in your folder? Simply open the "Properties/Settings" for the folder (right mouse button); Go to the "Sort" tab; and select/click on the option "Always maintain sort order." You can also assign the "Default sort attribute" (Name, Type, Size, etc.).

MINIMIZING WINDOW TO THE DESKTOP OR VIEWER

Can't figure out how to minimize your window to the desktop as opposed to the viewer? Go to the "System Setup" folder (normally located in the "OS/2 System" folder), and launch the "System" program. This will display a notebook with various settings. Go to the tab marked "Window." On that page there will be three radio buttons used to define "Minimize window behavior." You can elect to "Hide window," "Minimize window to viewer" (default setting), or "Minimize window to desktop" (click on this).

The "System" notebook also contains a variety of other settings that should be of interest to you.

RECORD A STREAM OF CHARACTERS FOR THE ENHANCED EDITOR (EPM.EXE)

For the Enhanced Editor (EPM.EXE), it is possible to record a stream of characters and then play it back later. This is a sort of cut and paste feature of the Enhanced Editor.

Steps:

       1. Press Cntl + R
       2. Begin typing your text (as much as you want)
               when completed...
       3. Press Cntl + R (your text is now saved)
       4. Position the cursor anywhere you wish to insert the text and press
          Cntl + T.

Note: This will not negate the use of the Shift/Insert-Delete functions.

ADD FREQUENTLY USED PROGRAMS TO THE MAIN SYSTEM MENU

The Warp Center and LaunchPad are great for a one-click launching of programs, but were you aware that you can modify the desktop's "settings" (as invoked by the right mouse button on a desktop focus) to include frequently used programs? To do so, select the desktop's "Properties/Settings" which will invoke a notebook of "Desktop - Properties/Settings." Go to the "Menu" tab on the notebook. Press the "Create another" pushbutton, and a pop-up "Menu Item Settings" dialog will appear. In the field marked "Menu item name," enter the name of the application, and; in the field marked "Program/Name," enter the name of the program. For example:

          Menu item name:  Enhanced Editor
          Program/Name:    EPM.EXE

Another way to do this is to 'drag and drop' an icon (using the right mouse button) into the "Actions on menu" field shown.

After closing the notebook, click on the right mouse button again and you will see your program added to the list. You can add to the list as much as you like. Using the same approach, you can also modify existing program settings or delete them from the list as desired. Can't remember the exact drive/directory location of the program? Use the "Find program" pushbutton on the "Menu Item Settings" dialog to locate it.

BASIC SAFETY BACKUP OF KEY FILES

"An ounce of prevention is worth a pound of cure." Saving a few basic OS/2 files can save you considerable trouble later on in the event of computer failure. As a preventative measure, backup the following files to either a diskette or another drive (preferably on another machine, such as a file server):

- CONFIG.SYS
- STARTUP.CMD
- AUTOEXEC.BAT
- OS2.INI
- OS2INIT.CMD
- OS2SYS.INI
- SYSTEM.INI (for Windows programs)
- WIN.INI (also for Windows programs)
- IBMLAN.INI (in the IBM LAN directory if you use IBM LAN Server

  To assure the backup is performed routinely, put COPY commands in your STARTUP.CMD file. Each time you boot-up the computer (each day for example), your files will be automatically copied to another drive.

RESTORING THE DESKTOP

I have used the following trick countless times with OS/2 Warp 3.0 for restoring the desktop when the OS2SYS.INI and the OS2.INI files disappear for no reason. These commands entered in a utility disk boot command line or a boot time Alt+F1 command line will rebuild these INI files to restore the desktop exactly the way it was before losing the two files. With modern OS/2 (Warp 4 or Warp 3 with a FixPak) these files maybe in a different directory.

The commands:

1. Reboot.

2. Press Alt+F1 when the OS/2 symbol appears to get a command line. Or with Utility Disks press ESC when "Welcome to OS/2" appears to get a command line.

3. Change to the OS/2 directory (where the OS2.INI and OS2SYS.INI files are suppose to be).

4. Enter command - Erase OS2SYS.INI

5. Enter command - Makeini OS2SYS.INI INISYS.RC

6. Enter command - Erase OS2.INI

7. Enter command - Makeini OS2.INI INI.RC

8. Reboot.

This is also listed in the Help file for Makeini. What is so cool about it is that it will rebuild the desktop with all the programs you have installed and exactly the way it was before corruption. It's also useful for people who do not backup files (me) and it saves 90 minutes of installation time plus finding all the icons of the programs installed.

(Courtesy of Mike Rivard)

UNDELETING FILES

OS/2 provides the means to UNDELETE files at the OS/2 command line (a little known trick that many users overlook). To do this, you must first edit the CONFIG.SYS file which comes with a DELDIR statement that is REMarked out (commented out), thereby disabling it; such as:

    REM SET DELDIR=C:\DELETE,512;D:\DELETE,512;E:\DELETE,512;

Simply remove the "REM" statement, so that it now appears as:

    SET DELDIR=C:\DELETE,512;D:\DELETE,512;E:\DELETE,512;

Next, create a DELETE directory (MD DELETE) on each drive that you want to use this feature on. In the example above, drives C, D, and E are listed.

Instructions: After you have deleted a file (by accident or by purpose), simply go to the OS/2 command line (window or full screen) and the directory where the file was deleted and type the UNDELETE command; for example:

    C:\UNDELETE (file name)

The computer will then prompt you to confirm your undelete of the file. For more information on this feature, type at the OS/2 command line: HELP UNDELETE

SIZING OS/2 WINDOWS

Have you ever wanted an OS/2 window to be sized to a certain dimension (height and width) upon launch (start)? Or have you ever wanted to have the window maximized or positioned to a certain area on the screen at time of launch? The secret to this is the SHIFT key.

To size an OS/2 window, launch the window then hold the shift key down; use the mouse sizing frame to size the window, then release the shift key. The next time you launch an OS/2 window it will be sized accordingly.

To maximize the window, perform the same type of operation: launch the OS/2 window, hold the shift key down, maximize the window, and release the shift key. To position the maximized window: hold the shift key down, click on the title-bar and drag the window to where you want it positioned, then release the shift key.

To negate the window move/sizing, simply press Shift + right-click the mouse on the windows Maximize box (upper right hand corner). NOTE: This only works on OS/2 Window command prompts.

DISPLAYING THE WARP CENTER

If your desktop becomes cluttered and you can't easily see and access the WarpCenter (due to windows covering it), to bring it foreground, simply double-click on any "free" space on the OS/2 desktop.

(Courtesy of Melvin Klassen)

CONCATENATING FILES

To concatenate a set of files (add one file to another and another, etc.), go to the OS/2 command line (full screen or window) and use the COPY command along with the plus (+) and equal (=) operators to string files together. For example:

    COPY FILE_1.TXT + FILE_2.TXT + FILE_3.TXT = FILE_4.TXT

In the example above, the first three files will remain unchanged. The last file (FILE_4.TXT) can either be a new file (created by the command) or an existing file that is appended.

DELETING OR EDITING "READ ONLY" FILES

Sometimes a program's software installation routine will place certain "read only" files on your fixed disk. Afterwards you may wish to delete or edit such files. However, because they have the "read only" attribute assigned to them you cannot do so. How do you overcome this problem? Use the ATTRIB command from the OS/2 command prompt; for example:

    ATTRIB -R (file name)

This command removes the "read only" attribute from the file. You can now edit or delete the file accordingly. To re-assign the "read only" attribute, use the following command:

    ATTRIB +R (file name)

WARNING! Use extreme care in using this command. OS/2 itself makes extensive use of "read only" files. Use this command only when you are sure of the file you wish to change.

MOUSE BUTTON TAP TO COPY/PASTE TO/FROM OS/2 CLIPBOARD

A convenient technique for performing the copy/paste functions with nothing more than the two mouse buttons:

Using the left mouse button, select text or graphic then tap the right mouse button. This copies the selected text or graphic to the clipboard.

Position the cursor accordingly with the right mouse button and tap the left button. This then performs a paste from the clipboard.

This technique works for most text/graphic windows in native OS/2 programs, including the EPM Enhanced Editor, DeScribe, Lotus Word Pro & Freelance, Netscape, or in an OS/2 Window or Full Screen. Surprisingly, it does not work in the OS/2 System Editor

(courtesy of Clive W. Humble via Terry Kemp in Australia)

SOME USEFUL OS/2 COMMANDS

We all understand basic OS/2 and DOS commands, such as DIR, COPY, MOVE, RENAME, etc., but here are some other useful OS/2 commands that are often overlooked:

- BACKUP - handy OS/2 routine for compressing files and backing them up to another disk or diskette. (see Restore).

- DATE - displays the current date according to the computer clock and provides the user with the means to change it.

- PSTAT | MORE - displays all of the active processes currently executing under OS/2. "PSTAT" alone shows all of the active processes, the "| MORE" displays the same data one page at a time, prompting the user to hit the ENTER key for "More".

- RESTORE - handy OS/2 routine for restoring files as assembled by the OS/2 "Backup" routine. (see Backup).

- RMVIEW /DC | MORE - used to display your hardware resources, particularly "Plug N Play" devices. Also shows IRQ resources and I/O. "RMVIEW" alone displays the devices, the "| MORE" displays the same data one page at a time, prompting the user to hit the ENTER key for "More".

- SYSLEVEL - as introduced with FixPak 10 of OS/2 Warp 4, this command is used to display FixPaks installed on your computer.

- TIME - displays the current time according to the computer clock and provides the user with the means to change it according to a 24 clock; e.g., 14:00 = 2:00 pm.

- UNPACK - to unpack a compressed OS/2 file (as commonly found in the Archive directory; example:

      UNPACK FILE.DL_

- VER /R - displays the current version of the operating system; for example:

      The Operating System/2 Version is 4.00
      Revision 9.033

  This represents FixPak 9 under OS/2 Warp 4.0

START EDITORS FROM DOS SESSION

To start an OS/2 editor from a DOS session (works only in Warp 4 I am told):

Add the following lines to your OS/2 AUTOEXEC.BAT (adjusting drives and paths where appropriate):

    DOSKEY TEDIT=CMD /C C:\OS2\TEDIT.EXE $*
    DOSKEY EPM=CMD /C C:\OS2\APPS\EPM.EXE $*
    DOSKEY NOTEPAD=CMD /C C:\OS2\MDOS\WINOS2\NOTEPAD.EXE $*
    DOSKEY EOS2=CMD /C C:\OS2\E.EXE $*

(the first DOSKEY entry should be a LOADHIGH statement).

Now, you will be able to start the following from a DOS session command line:

- TEDIT - will start the TEDIT editor (TEDIT.EXE)

- EPM - will start the OS/2 EPM Enhanced Editor (EPM.EXE

- EOS2 - will start the OS/2 System Editor (E.EXE)

- NOTEPAD - will start the Win-OS2 Notepad Editor (NOTEPAD.EXE)

This approach can be used for other programs that you may wish to start from a DOS session.

(Courtesy of Doug Bissett)

ENHANCED DOS COMMANDS

The version of DOS and related utility programs that comes with OS/2 is essentially DOS 5.0. Later DOS versions have enhanced some of the commands (like MEM, and FORMAT). To use these enhanced programs, from your OS/2 DOS sessions, do the following:

Add the following lines to your OS/2 AUTOEXEC.BAT (adjusting drives and paths where appropriate):

    DOSKEY MEM=C:\DOS\MEM $*
    DOSKEY FORMAT=C:\DOS\FORMAT $*

(the first DOSKEY entry should be a LOADHIGH statement).

Next, you need to tell the DOS session to lie to the programs about what version of DOS is running. Go to OS/2 System-> Command prompts-> Right mouse click on the DOS icon (do this for all of the DOS sessions where you might want to use the updated programs)-> Properties-> Session-> DOS properties-> Other DOS settings-> OK-> DOS_VERSION-> scroll to the bottom of the list and add the appropriate entry-> Save.

I use IBM PC-DOS 7.0, so the entries would be:

    MEM.EXE,7,0,255
    FORMAT.COM,7,0,255

Adjust the version and sub version for the DOS that you have installed (you don't really need DOS installed, just the appropriate files, but you really should be licensed to use the DOS on your machine). These entries are only required, if the program complains about DOS being the wrong version.

(Courtesy of Doug Bissett)