%Username% Resolved in GUI but Not at Command Line

ID: Q197447


The information in this article applies to:
  • Microsoft Windows NT Server version 4.0
  • Microsoft Windows NT Workstation version 4.0


SYMPTOMS

When you add a system environment variable using the System tool in Control Panel, the %Username% will translate in the GUI of the tool to the user who is currently logged on, but will not in a command prompt.


RESOLUTION

To work around this problem, you can use the SETX command in a logon script to add the environment variable each time a user logs on. The SETX command can be found in the Windows NT 4.0 Resource Kit.

Additional query words:

Keywords : kbbug4.00
Version : winnt:4.0
Platform : winnt
Issue type : kbprb


Last Reviewed: November 11, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.