Stupid OS/2 Tricks/System Tips

From EDM2
Jump to: navigation, search
Stupid OS/2 Tricks

Keeping applications from restarting at boot

When OS/2 is started, it automatically opens applications which were open during the last OS/2 session. To keep applications from restarting on boot, you can use either the manual or automatic method.

Prevent restarting manually

To prevent applications from restarting during boot, hold down the Ctrl, left Shift, and F1 keys at the same time, beginning when the mouse pointer appears until the icons begin appearing on the desktop. If you find that disk activity stops, you may have to release the keys and then quickly hold them down again.

Prevent restarting automatically

Placing the line

SET RESTARTOBJECTS=STARTUPFOLDERSONLY,REBOOTONLY

into your CONFIG.SYS file will prevent any applications which had been open in the last session from opening, but will allow programs in the Startup folder to open. (this line may be order-dependent on some systems)

Shutting down without a mouse

To shut OS/2 down without a mouse, press Ctrl-Esc to bring up the Window List, choose the Desktop, press the Spacebar to deselect any icons, press Shift-F10 to pop up the Desktop's menu, choose Shutdown.

Rebooting from the command line

To reboot OS/2 down from the command line, type

SETBOOT /B

Note: the above only works with Boot Manager installed.

or

SETBOOT /IBD:<drive>

where <drive> is the letter of the drive or partition to which you wish to boot

Related subject(s):

  • Keeping applications from restarting at boot
  • SHUTDOWN.CMD

Finding settings for original objects

The settings for all of the objects which were created upon installation of your OS/2 system are contained in the INI.RC file, located in the \OS2 subdirectory. Those handy with REXX and the external REXXutils can use the information contained in the INI.RC file to rebuild the original OS/2 objects.

Related subject(s):

  • Replacing your Shredder if deleted

Controlling order of execution in Startup folder

Startup folder in Flowed view with item being dragged into it.

You can control the order in which objects in your Startup folder execute.

  1. Open the Startup folder in either Flowed or Non-flowed view.
  2. Drag objects or their shadows into the Startup Folder in the order you want them to execute.

Backing up the *.ini files

Much of your system's customization is stored in two files, OS2.INI and OS2SYS.INI. To back up these important files, add the following line to the beginning of your CONFIG.SYS:

CALL=<drive1>:\OS2\XCOPY.EXE <drive2>:\OS2\OS*.INI <drive3>:\<path>

where

<drive1> is the letter of the drive in which XCOPY.EXE is found
<drive2> is the letter of the drive in which the *.ini files are found
<drive3> is the letter of the drive in which you would like to locate the backups of the *.ini files
<path> is the path in which you would like to locate the backups of the *.ini files

Note: The 2.11 CSD adds the System attribute to OS2.INI and OS2SYS.INI. In order for this tip to work, you should use XCOPY's /T /R /O switches at the end of the CALL command above.

Related subject(s):

  • Restoring last desktop backup

Removing device drivers for better performance

contributed by Jack Tan

If you aren't using the DOS subsystem, you can improve performance by removing DOS-specific device drivers from loading in your CONFIG.SYS (they generally begin with the letter V). The same applies to Win-OS/2, HPFS, CD-ROM drivers as well.

Related subject(s):

  • Getting memory back from unused caches

Speeding up some IDE drives

contributed by Jack Tan

Try adding switches to the BASEDEV=IBM1S506.ADD line:

BASEDEV=IBM1S506.ADD /A:0 /U:0 /SMS

and use /V to see if the /SMS works (/V = verbose). This is supposed to speed up IDE drives that support this feature; otherwise, it will be ignored.

(note: the switches above affect the first drive on the first adapter in the system -- for more information on the switches, search for "basedev" in your online OS/2 Command Reference)

Disabling use of the floppy drives

by Darius Vaskelis

To prevent users from using the floppy drives under OS/2, such as in a workstation situation:

Remove the following line from your CONFIG.SYS:

BASEDEV=IBMxFLPY.ADD

Where x is 1 for ISA and EISA, or 2 for Microchannel.

Getting Epson ActionLaser 1500 to work

To get an Epson ActionLaser to work with OS/2 2.1:

  1. First, follow the standard steps for non-working printers under OS/2:
  2. Make sure you have a compliant cable. A parallel cable should have all 25 pins wired, unfortunately, a lot of cables currently manufactured only have 18 pins wired.
  3. Check your interrupts. ISA and EISA bus machines cannot share interrupts under OS/2. Often, a sound card will be set to the same interrupt as LPT1 (IRQ7), and must be changed.
  4. Get a compatible I/O card. Some parallel port cards don't seem to work correctly under OS/2.
  5. Finally, for the Epson ActionLaser, change the "Busy Delay" to +5 (covered in p.4-15 of the Epson's manual).

Getting memory back from unused caches

from the OS/2 2.1 Technical Reference

You can increase available resources by disabling unused caches. If you are running an HPFS-only system, remove (or REM) the DISKCACHE line in your CONFIG.SYS file. Similarly, if you are running a FAT-only system, remove (or REM) the IFS=<drive>:\OS2\HPFS.IFS line in your CONFIG.SYS.

Related subject(s):

  • Removing device drivers for better performance

Dealing with OS/2 !! SYS messages on boot

contributed by Jack Tan

The error message:

OS/2 !! SYS01475
OS/2 !! SYS02027

means that the system files can't be found. Try removing any diskettes from the disk drives. If this message appears when trying to boot from a hard disk, use SYSINSTX to restore the OS/2 system files.

Restoring last desktop backup

contributed by Jack Tan

To make the Alt-F1 trick restore your last desktop backup instead of the (ugly) default, replace the CONFIG.SYS, OS2.INI, and OS2SYS.INI in \OS2\INSTALL with the files from your last backup. Make sure to save the original files in \OS2\INSTALL before replacing them.

Related subject(s):

  • Backing up the *.ini files

Viewing *.inf files more conveniently

contributed by Jack Tan

Here are two tips to make viewing OS/2 *.inf files more convenient:

1. Put several INF files together using a plus sign. On the command line (or 'Parameters' field of the settings notebook), enter something such as:

e.g., <drive>:\BOOKS\FILE1.INF+<drive>:\BOOKS\FILE2.INF+ <drive>:\BOOKS\FILE3.INF.

The pathnames aren't necessary if the file is in a directory specified by the HELP environmental variable.

2. You can assign the book names to an environmental variable:

e.g., SET FILE=<drive>:\BOOKS\FILE1.INF+<drive>:\BOOKS\FILE2.INF+ <drive>:\BOOKS\FILE3.INF

and execute VIEW.EXE using the variable name (e.g., VIEW FILE).

Using less memory for DOS images

When you load a DOS image file (Virtual Machine Boot, or VMB), the entire diskette image is loaded into memory. Since the files on the DOS image diskette don't take up much room themselves, much of the memory used for the diskette is wasted. Therefore, in order to regain memory when loading the specific DOS session, try using double-density diskettes to make your DOS images, instead of high-density diskettes.

Booting OS/2 in full-screen mode

You can boot OS/2 in full-screen mode, and still retain Presentation Manager support for multiple sessions:

1. Change:

SET RUNWORKPLACE=<drive>:\OS2\PMSHELL.EXE

in your CONFIG.SYS file to:

SET RUNWORKPLACE=<drive>:\OS2\CMD.EXE /FS

where <drive> is the drive on which OS/2 resides.

2. Create the file STARTUP.CMD in your OS/2 boot drive's root directory. STARTUP.CMD should contain the following lines:

@ECHO OFF
START /FS
 EXIT

Related subject(s):

  • Using OS/2 without the Workplace Shell

Completing shutdown

If shutdown seems to "hang" at the first shutdown message box, this trick sometimes works:

  1. Press the Ctrl-Esc keys.
  2. Wait for about a minute.
  3. In many cases, a dialog box will pop up telling you that the Workplace Shell isn't responding to system requests, and will give you the choice of clicking on Enter to end the application, or Cancel.
  4. Click on the Enter box. The shutdown usually proceeds normally.

Adjusting your swap file

If you have disk space to spare, you can adjust the default startup size of your swap file (SWAPPER.DAT) to improve system performance.

The default startup size of SWAPPER.DAT is set in your CONFIG.SYS file with the line:

SWAPPATH=<drive>:\<path> <minfree> <swapsize>

where <swapsize> is the default startup size of SWAPPER.DAT.

To adjust the startup size for better performance:

  1. Monitor the size of the SWAPPER.DAT over the course of a normal day's work. A third-party utility for monitoring swap file size makes this task a bit easier.
  2. Note the maximum size that SWAPPER.DAT reaches during normal usage.
  3. Change the <swapsize> parameter of SWAPPATH to reflect at least the maximum swap file size you noted (<swapsize> is measured in kilobytes).
Caution
You MUST have enough free drive space to use this tip. If the size of the <swapsize> parameter violates the amount needed for the <minfree> parameter, your system will not boot.

Using SVGA.EXE under real DOS

contributed by Jack Tan

Running SVGA.EXE in a VDM usually results in a file called SVGADATA.PMI, which contains information which lets OS/2 access SVGA graphics modes.

Sometimes, SVGA.EXE has trouble "seeing" the video chip, and extended graphics modes won't work correctly. If so, try running SVGA.EXE under real DOS or a VMB. This will create a file named SVGADATA.DOS. Rename SVGADATA.DOS to SVGADATA.PMI and copy it into your \OS2 subdirectory.

Loading a DOS device driver into high memory

DOS Settings for loading a device driver high.

contributed by Xavier Caballe

In order to load a DOS device driver into high memory in a particular DOS Session:

  1. Open the settings notebook for the DOS object.
  2. Choose the Session tab.
  3. Click on the DOS Settings button.
  4. Highlight the DOS_DEVICE setting.
  5. Add 'SIZE=0' (without quotes) before the path and filename for the device driver to load in high memory. For example:
SIZE=0 C:\OS2\MDOS\ANSI.SYS

In this example, the ANSI.SYS will be loaded in the high memory area (if available).

Fixing "locked" INI files

contributed by Jack Tan

If your INI files (OS2.INI and OS2SYS.INI) stop saving system changes, they may have been marked read-only. To reset the read-only attribute:

  1. Change to your \OS2 subdirectory.
  2. Type
attrib -r os2*.ini

at an OS/2 command prompt.

  1. You may have to shutdown and reboot.

Note: if using OS/2 2.0, you may have to boot OS/2 from your installation floppies in order to reset the attributes.

Playing audio CDs via REXX

contributed by Xavier Caballe

The combination of REXX with MMPM/2 can be quite powerful, as demonstrated by CDPLAY.CMD, a "poor man's CD player."

Note: requires MMPM/2

Related subject(s):

  • Playing media files from the command line

Playing media files from the command line

contributed by Jack Tan

Note: MMPM/2 is required.

  1. To play a media file, use PLAY.CMD (included in MMPM/2, and requires REXX) or MPPM.EXE.
  2. To play a media file immediately (i.e., no need to hit the "Play" button in the Media Player window) and close the session afterwards, use MPPM.EXE /SC <filename>, where <filename> is a WAV or AVI file.
  3. To play a media file immediately, close the session afterwards, and not see the Media Player window, use START /MIN MPPM.EXE /SC <filename>, where <filename> is a WAV or AVI file.

Related subject(s):

  • Playing audio CDs via REXX

Determining if you have a buffered UART in your computer

A buffered UART (such as the 16550AF chip) is often necessary for error-free serial communications in a multitasking environment.

To determine if your computer has a buffered UART:

  1. Open an OS/2 command line session.
  2. Type
MODE COMx

where x is the number of the serial port you wish to check.

  1. A list of current settings for the serial port should appear. If the line
BUFFER=N/A

appears, you do not have a buffered UART. If the BUFFER line contains anything other than N/A, you have a buffered UART.

Pooling multiple printers

Choosing multiple ports for the printer object.

If you have more than one printer that use the same printer driver, and each is attached to different parallel or serial ports, you can configure your printer object so that waiting print jobs will be sent to any free port.

"Pooling" multiple printers:

  1. Open the Settings notebook for the printer object.
  2. Click on the Printer Driver tab.
  3. Highlight the desired printer driver.
  4. Click on the Output tab.
  5. Hold the Ctrl key while selecting all the desired ports with mouse button 1.
  6. Close the Settings notebook.

Viewing the Nowhere subdirectory

Note: this trick does not appear to work in OS/2 Warp

Ever wonder what the subdirectory called Nowhere on your OS/2 boot drive is? The Nowhere subdirectory is a place where transient objects are stored.

Stupid44.png

Since each directory represents a folder, you can view the Nowhere directory, and watch object appear and disappear in it:

  1. Bring up the desktop's popup menu by clicking once on the desktop with mouse button 2.
  2. Choose Find.
  3. In the entry box next to "Folder:" type <drive>:\ where <drive> is the letter of the drive on which OS/2 is installed.
  4. Click on the Find button. All of the objects in the root directory of your OS/2 drive should appear in a folder.
  5. Open the folder named "Nowhere." (Note: you may have to open it in Icon view via its popup menu, depending on how your system defaults are set.)
  6. You should see some objects in your open Nowhere folder.

Caution Do not manipulate any of the objects in the Nowhere folder! Simply observe!

  1. Try opening and closing folders on your desktop; you should see objects appear and disappear from the Nowhere folder.
  2. When you are done watching the Nowhere folder, close it, then feel free to delete the Find Results folder, since the objects in it are only shadows, not the actual objects.

Backing up INI files in the background

contributed by Jorge Omar

If you would like to backup your OS2.INI and OS2SYS.INI files in the background during the boot process: 1. Create an OS/2 batch file named BACKINI.CMD:

ATTRIB -S <drive>:\OS2\OS2*.INI
COPY <drive>:\OS2\*.BK1 <drive>:\OS2\*.BK2
COPY <drive>:\OS2\OS2*.INI <drive>:\OS2\*.BK1
ATTRIB +S <drive>:\OS2\OS2*.INI

where <drive> is the drive on which OS/2 resides. Note: the ATTRIB command is only needed for systems running OS/2 2.11 and higher. 2. Open the Templates folder. 3. Drag off a program template and place it into the Startup folder. A Settings notebook should open. 4. In the Path and File name box, fill in the necessary information for BACKINI.CMD. 5. Click on the Session tab. 6. Place a check mark next to Start Minimized. 7. Close the Settings notebook.

A variation of the above BACKINI.CMD uses XCOPY switches rather than using ATTRIB to reset the System attribute:

BACKINI.CMD:
 XCOPY <drive>:\OS2\*.BK1 <drive>:\OS2\*.BK1 /T /R /O
 XCOPY <drive>:\OS2\OS2*.INI <drive>:\OS2\*.BK1

Note: the files OS2.BK1, OS2.BK2, OS2SYS.BK1, OS2SYS.BK1 must exist in <drive>:\OS2\ before this will run!

Related subject(s):

  • Backing up the INI files

Caching your cdrom drive

You can adjust the read cache for your CD-ROM drive. In your CONFIG.SYS, you can add a switch to the end of the cdrom IFS line:

IFS=<drive>:\OS2\CDFS.IFS /C:<number>

where <drive> is the drive on which CDFS.IFS is located <number> is the number of 64K segments used for the cache. The default is 2, or 128K (2 x 64K = 128K).

Resetting Boot Manager to have no default partition

contributed by Jack Tan

Boot Manager can boot to the partition from which the system was last started, but once you select a default partition from which to boot in Boot Manager, you lose the ability. To reset Boot Manager so that it has no default value, issue the following command at an OS/2 prompt:

SETBOOT /0:

Booting DOS from a C: partition within OS/2

You can create a Virtual Machine Boot to boot real DOS from the C:. partition, rather than the typical floppy boot if you are running a Boot Manager system with real DOS on the primary (C:) partition. Point the Virtual Machine Boot at the C: partition by setting DOS_STARTUP_DRIVE to C:. OS/2 must be installed on a logical drive.

Related subjects:

  • Using less memory for DOS images

Resetting the boot record

contributed by Jack Tan

If your boot record should become damaged, you can reset your boot record by typing the following at an OS/2 prompt:

FDISK /NEWMBR

Stop DHCP Server Search at Boot

It may happen that under a Wireless network when you boot OS/2 you will get a DHCP timer (60 secs) and you want to get rid of this message.

Open with the text edit the following file "X:\MPTN\BIN\SETUP.CMD" (where X is your OS/2 drive). Search for the "dhcpstrt" line and change the default time to 0 by adding "-d 0". It make look like:

dhcpstrt -i lan0 -d 0

This will stop the DHCP search on the OS/2 boot.