Using the Same System Login Script for OS/2 and DOS

From OS2World.com Wiki
Jump to: navigation, search

Return to The Warp Pharmacy:Software

Last update: 6th November, 1995


Symptoms

When running Netware's OS/2 version LOGIN.EXE, Warp does not use the login script used by the DOS version of LOGIN.EXE.

Hardware

N/A

Problem

OS/2 uses its own login script, NET$LOG.OS2 rather than NET$LOG.DAT. Many sites wish to standardize having all logins go through a single centralized login script.

Procedure

You can point the OS/2 login script to the DOS login script by having putting a single line in net$log.os2:


        include sys:public\net$log.dat


The login scripts reside on the server in the SYS:PUBLIC directory


Notes

External Commands

Overall, the way Netware scripting works for OS/2 and DOS are very similar. But there are differences. For example, the way external programs are called. With OS/2 scripts, having the command on the path is sufficient, where with the DOS scripting you need to specify where the external command resides. In the example below, the login script maps the P: drive to sys:public. P:\OS2 is on both the path and dpath.


IF OS="MSDOS" THEN
  MAP ROOT S1:=SYS:PUBLIC
ELSE
IF OS="OS2" THEN
  MAP P:=SYS:PUBLIC
END
END

IF MEMBER OF "PRN_0987_HP3D" and OS="MSDOS" THEN
  #sys:\public\CAPTURE /s=%FILE_SERVER /q=0987_HP3D /l=2 /nt /ti=15 /nff /b
ELSE
IF MEMBER OF "PRN_0987_HP3D" and OS="OS2" THEN
  #CAPTURE /s=%FILE_SERVER /q=0987_HP3D /l=2 /nt /nff /b
END
END

You can also specify the external command using the UNC (Universal Naming Convention) method e.g.:

#\\FS1\SYS\PUBLIC\OS2\CAPTURE.EXE /s=%FILE_SERVER /q=0987_HP3D /l=2 /nt /nff /b

however, commands that also need data pathing (dpath) may have problems with this method as it only tells the system where to find the single executable you specify.

OS/2 and Search Drives

This brings up another difference between DOS and OS/2 Netware scripting. OS/2 does not support search drives. So "MAP S1:", "MAP INS:" etc. do not work. Search drives were invented by Novell to overcome a couple of DOS' deficiencies, the limited length available to the path statement, the lack of data pathing capabilities in DOS 3.x and below, and that DOS returns an error if an entry in the path does not exist. These limitations do not exist for OS/2.

The alternative to search drives for OS/2 is to predefine network paths in your the path and dpath statements in your config.sys. The Netware Requester install program does this for you by putting P:\OS2 in both your path and dpath statements. If your site does not define the P: drive as being redirected to sys:public, you may wish to modify your config.sys accordingly.


Other Netware Command Differences

In the example above, you may have also noted another difference the MAP command. With OS/2, you do not need to explicitly "MAP ROOT" and in all OS/2 mapping "ROOT" is implied. The fact is that the "ROOT" option for the MAP command was not added until after the original OS/2 Netware requester came out with its ability to map to a false root. This feature was demanded by users for the DOS version of MAP.EXE.

Also, in the example above, the parameters for CAPTURE are different. Since in OS/2 spooling of print files is a native function, the "/ti=99" (timeout) parameter is not acceptable syntax.


Testing Which Operating System

The example above also shows how to test to test from which operating system you login script is being run. The script identifier variable, "OS" can be tested upon so that when a command is only appropriate for only DOS or only OS/2 will only be run in that environment.

Editing the Login script

SYSCON.EXE is the tool that Novell provides for editing login scripts. Unfortunately the OS/2 version of this utility will only edit the OS/2 system login script and the DOS version of this utility will only edit the DOS login script.

As an administrator and an OS/2 user, you can run both utilities simultaneously on your PC -- the DOS utility requires that you virtualize IPX, run NETX and be set up as either a public or private session. Or you can directly edit the script file using an OS/2 editor such as EPM.EXE. And you can also login in multiple private DOS sessions testing the login script and rights for individual users and groups.



By Matt Hickman

Return to The Warp Pharmacy:Software