Environment Variable "NAME"

D

Dennis

Environ$("Name") grabs the User's Logon Name. Is this
the "NAME" environment variable and how do you change this
environment variable in Windows 2000?

I have tried going to the Control Panel --> System -->
Advanced Tab --> Click on Environment Variables button -->
Click on the "New" button in either the User or System
section --> Specifying "NAME" in the Variable Name field
and specifying another UserID other than my own as the
Variable Value. This does not work to change what the
Environ$("Name") function returns. I have tried setting
NAME, NWUSERNAME, DefaultUserName, Logon User Name,
DefaultNetwareUserName, USERNAME, Username (in case it is
case-sensitive), WINLOGONID, LOGNAME, USER, and LOGIN.
Environ$("Name") still shows my User ID.

I have also used Set from a command prompt, but this only
sets the value for that process and doesn't change the
parent process. I have tried using SetX, but I believe
this just adds the "NAME" value similar to the method
described above (Control Panel --> System, etc.).

I wanted to show that using Environ$ for security was not
the way to go, but rather User-Level Security should be
implemented. By showing how easy it is to change this
environment variable, the security implication would be
more apparent to those that don't realize the volatility
of this information. It's turning out to be a bit more
difficult to locate than I thought at first. I appreciate
the help with this one !!!
 
D

Dennis

The answer is CurrentUser and it can be changed from the
Control Panel method described below.
 
D

Dennis

I thought that this was perhaps the CurrentUser
Environment Variable. I added CurrentUser to the
Environment Variables screen in both the User and System
sections. I may have also made the change in the Registry
as I was jumping about a lot at that point. I had checked
and found that Environ$("Name") showed with the new User
ID that I had entered. Since I was changing a lot of
Environment Variables in my quest for the one correlating
to "Name," did I inadvertantly change another Environment
Variable (i.e. which on correlates to Environ$("Name")) or
does another Environment Variable have to also be changed,
which is overriding CurrentUser as the value picked up as
the "net" value for Environ$("Name")? I appreciate the
help :) !!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top