DOS LAN Man Logon Scripts Load Incorrectly from Windows 3.00

ID Number: Q66976

2.00

MS-DOS

Question:

When I log onto DOS LAN Manager from within Windows version 3.00 (for

example, from the Windows Control Panel), my LAN Manager logon scripts

are not executed. Why is this happening?

Response:

This is known behavior under Windows version 3.00 and arises from the

inability to synchronize separate COMMAND.COM sessions under Windows.

When DOS LAN Manager logs a user onto the network, it performs the

following three steps (at a high level) to execute the logon script:

1. Add a USE for the NETLOGON share at the server processing the logon

(for example, NET USE Z: \\xxxxx\NETLOGON).

2. Execute the user's logon script (for example, Z:NETLOGON).

3. Remove the USE for the NETLOGON share (for example, NET USE Z: /D).

To run the logon script in step 2 (Z:NETLOGON), a new instance of

COMMAND.COM must be created [for example, by using a WinExec() call].

This new instance of COMMAND.COM does not run synchronously with the

DOS LAN Manager logon process, nor can it be made to run

synchronously. Unfortunately, Windows allows the DOS LAN Manager logon

code to continue executing before control is passed to the new

COMMAND.COM instance. This causes step 3 (the removal of the USEd

drive) to be executed before the logon script is given a chance to

run. When Windows does let the new COMMAND.COM process execute, the

USEd drive (Z:, in the above example) is gone and the logon script

does not execute.

If logon scripts are needed, you should issue a NET LOGON command

prior to starting Windows. Alternatively, you can use a DOS LAN

Manager profile instead of a script. See the "Microsoft MS-DOS LAN

Manager User's Guide" for more information on this topic.