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

Last reviewed: September 23, 1997
Article ID: Q106102
The information in this article applies to:
  • Microsoft Windows NT operating system version 3.1
  • Microsoft Windows NT Advanced Server version 3.1
  • Microsoft Windows NT Workstation versions 3.5, 3.51, and 4.0
  • Microsoft Windows NT Server versions 3.5, 3.51, and 4.0

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.

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

  1. 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
    

  2. 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.

  3. 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 : ntnetserv ntutil kbnetwork
Version : 3.1
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 23, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.