PRLAN9111005: Logon Scripts and Environment Space

ID Number: Q78358

2.00

MS-DOS

buglist2.00 fixlist2.10

Summary:

The following information applies to LAN Manager version 2.0 running

under MS-DOS version 5.0.

Problem ID: PRLAN9111005

SYMPTOMS

Logon scripts that are set up and run properly under MS-DOS

versions 4.0 and earlier may run out of environment space after the

system is upgraded to MS-DOS 5.0. This problem occurs even after

attempting to increase the environment space with the /E switch on

the SHELL=\command.com /E:1024 /P command (for example, even the

/E:32786 setting results in the logon scripts running out of space

almost immediately).

CAUSE

Due to the memory management activities MS-DOS 5.0 performs, the

environment space is not managed in the same manner as it was in

earlier versions of MS-DOS. When logon scripts are enabled, a

second copy of the command shell (COMMAND.COM) is started. It in

turn runs the logon scripts. When a new COMMAND.COM is spawned, it

uses the lower default environment space allocation. Thus, no

matter what is set in the SHELL= command line, the low environment

space allocation will always be used. Because most logon scripts

contain NET USE commands (which each require memory) in addition to

environment variables, the environment space is exhausted rapidly.

RESOLUTION

To retain this functionality in the logon scripts under MS-DOS 5.0,

use the following workaround:

1. In the current logon script, echo all NET USEs and SETs to a

batch file. For example:

echo set s_user=KATHY > c:\user.bat

echo set s_mbox=kathy, J1 >> c:\user.bat

echo net use v: \\traveler\public >> c:\user.bat

This will create the batch file USER.BAT, customized for each

user when they log on. Note that the first echo line contains a

single angle bracket (>), which creates the file USER.BAT.

Subsequent echo lines contain double angle brackets (>>), which

append the lines to the end of the newly created batch file.

2. Create a generic logon batch file for the user to run instead of

issuing a NET LOGON command. For example:

net logon %1 %2

call c:\uses.bat

del c:\uses.bat

Typing "logon <user> <password>" will now log on the user. The

logon script will create the USES.BAT file, customized for the

user. Once the logon has completed, the USES.BAT file is called

and all NET USEs (and SET commands) are performed. The USES.BAT

file is then removed.

To ease the administration of having additional batch files, the

LOGON.BAT can be created on the PDC (primary domain controller) and

then replicated with the logon scripts.

STATUS

Microsoft has confirmed this to be a problem in LAN Manager version

2.0. This problem has been corrected in LAN Manager 2.1.