Microsoft KB Archive/106102

= Environment Vars in Logon Scripts on a Non-Windows NT Client =

Article ID: 106102

Article Last Modified on 11/1/2006

-

APPLIES TO


 * Microsoft Windows NT Advanced Server 3.1
 * Microsoft Windows NT Server 3.5
 * Microsoft Windows NT Server 3.51
 * Microsoft Windows NT Server 4.0 Standard Edition
 * Microsoft Windows NT Workstation 3.1
 * Microsoft Windows NT Workstation 3.5
 * Microsoft Windows NT Workstation 3.51
 * Microsoft Windows NT Workstation 4.0 Developer Edition
 * Microsoft Windows NT Advanced Server 3.1

-



This article was previously published under Q106102



SUMMARY
If you use Windows NT system environment variables in a logon script, those environment variables will not be correctly resolved when you attempt to log on to a non-Windows NT client.

NOTE: This can also occur in Windows 95, 98, and 98 SE.



MORE INFORMATION
Windows NT allows you to specify a logon script as part of the profile for each user name account on the domain and on the local computer. Each time an attempt is made to log on with a particular user name, the user name's associated logon script will execute. Within the logon script, you may include Windows NT system environment variables. However, if you attempt to log on to a Windows NT Advanced Server-based domain from a non-Windows NT client, any Windows NT system environment variables contained within the logon script will not be resolved on the non-Windows NT client. This is expected behavior because the Windows NT system environment variables are not defined on the non-Windows NT client.

Steps to Reproduce Problem
  Create the following logon script in any text editor and save it as TSTSCRPT.BAT:

     echo off echo hello %USERNAME% echo thank you for logging on to %USERDOMAIN% pause  Using User Manager for Domains on a Windows NT Advanced Server Domain Controller, create a domain user account called 'Test' and modify the profile so that TSTSCRPT.BAT is specified as the Logon Script Name.  Log on to the domain from a client computer running a non-Windows NT networking operating system, such as LAN Manager or Windows for Workgroups 3.1. The logon script will execute and the following will be displayed on the screen:

     hello thank you for logging on to     Press any key to continue... 

The environment variables %USERNAME% and %USERDOMAIN% will not be resolved, thus leaving no information on the screen for those values.

Additional query words: wfw wfwg prodnt

Keywords: kbnetwork KB106102

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.