Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2002
    Posts
    25

    Unhappy Unanswered: Environ$("Name")

    Environ$("Name") grabs the User's Logon Name. Is this the "NAME" environment variable and how do you change this particular 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 !!!

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    CurrentUser

    Try

    CurrentUser

    For network and machine names, try Dev Ashish's excellent "Access Web" Here:

    http://www.mvps.org/access/modules/index.html
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Jul 2002
    Posts
    25

    Talking You are the man !!!!

    garethdart - You have it !!!!!! I think I tried everything BUT this variable name. I spent a lot of time trying to run this one down yesterday and today and you just nailed it. Thank you so much for responding and really helping me out with this !!!!! That's a huge help and is GREATLY appreciated !!!!

  4. #4
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    Wink Merry Christmas

    No worries - consider that your Christmas present!
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  5. #5
    Join Date
    Jul 2002
    Posts
    25

    Red face One last present under the tree?

    Dear Santa garethdart (and any other Santa Helpers),

    I seem to be losing my mind. After your last E-Mail I went to Control Panel --> System --> Advanced Tab --> Environment Variables button and I set CurrentUser in both the User and System sections to another User ID other than my own. I may have also made the change in the Registry as I was jumping around a lot at that point. Well, I rebooted because I wanted to see if I only needed to change CurrentUser in either the User -or- System section. Now, Environ$("Name") is still showing my UserID even after I add different values to CurrentUser to both the User and System sections of the Environment Variables screen. When I check the Registry I see that the values for CurrentUser have been correctly changed to another User ID other than my own (what I was trying to do). Am I missing something obvious here or do I have Gremlins in the machine?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •