Try the following to locate the problem statement in the login script:
Set MAP DISPLAY and MAP ERRORS to ON in the login script.
By setting MAP DISPLAY and MAP ERRORS to ON, the errors display, often providing clues as to why a certain command did not execute as expected. After seeing that the login script performs all map commands without error, the MAP DISPLAY and MAP ERRORS parameters can be turned OFF.
Use the WRITE or MAP commands together with the PAUSE command prior to the script command which doesn't work as expected.
By adding the PAUSE command after the WRITE or MAP command, you have an opportunity to see what is happening when the script is executed.
For example, if the login script didn't seem to be completing an IF..THEN statement, put both a WRITE and a PAUSE statement immediately before the IF..THEN statements to verify that the script executed to that point. Then, place a WRITE and PAUSE inside the IF..THEN to see if it gets past the IF correctly. It would also be helpful to have the WRITE statement give the value of the variables being tested to make sure that the variables are correct going into the script. For example, WRITE "This is the login name: %LOGIN_NAME".
You can also use the PAUSE command with the MAP command to determine when and where a certain mapping was created in a login script.
Make a test login script file either on the local drive or a network drive using any DOS text editor.
Test this script file by using the /S parameter at the DOS prompt:
LOGIN /S drive:\filename servername/username
If this login script works correctly, copy each statement from this login script into the login script that doesn’t work correctly. This way, problems in login scripts can be dealt with by elimination.