%Username% Resolved in GUI but Not at Command Line (197447)



The information in this article applies to:

  • Microsoft Windows NT Server 4.0
  • Microsoft Windows NT Workstation 4.0

This article was previously published under Q197447

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.

Modification Type:MajorLast Reviewed:8/10/2001
Keywords:kbprb KB197447