View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
riso riso is offline
external usenet poster
 
Posts: 16
Default Environ("username")

I have checked also user directories for these accounts.

C:\Documents and Settings\admin .... for user with administrator right
C:\Documents and Settings\weekuser .... for user Smith (his login name
is Smith)
C:\Documents and Settings\user1 ..... for user User2


Is something wrong with instalation of XP Windows?

thanks



On Mar 8, 9:45 am, "riso" wrote:
Thank for your answer.

I have tried it myself. I logged on as XP windows administrator and
changed account name from weakuser to testuser.

In the login screen (that one with pictures and account names) is
written "administrator" and "testuser". When logged as testuser I have
started excel and try msgbox Environ("username"). It shows "weakuser".

Moreover. I have thought that it is related to usage of imagedisk. I
have created completely new account "user1", logged in, runned excel
and msgbox. It showed user1. logged off, logged in as administrator,
changed account name to user2, logged off, restarted computer, logged
in as user2 (it was showed in the login screen), runned excel and
msgbox. It shows user1. Still original account name.

Maybe it is related to corrupted XP windows, but I doubt.

On Mar 8, 9:23 am, "NickHK" wrote:



Sounds like the Accounts' usernames were not changed "correctly" somehow.
Works for me with just log-off/on; correctly username is returned.
Are you sure the usernames were actually changed ?


NickHK


"riso" wrote in message


roups.com...


Yes.


Environ("username") returns 'weakuser' for weeks. Users' computers are
turned off daily.


thanks


On Mar 6, 10:22 pm, "Bob Phillips" wrote:
Have you logged off of those machines and logged back on since?


--
---
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my

addy)


"riso" wrote in message


oups.com...


Hi folks,


An IT administrator 'created' 10 PC with windows XP with 2 users,
namely "administrator" and "weakuser", with an imagedisc. Later
administrator logged in to every computer and changed the account name
of the user from 'weakuser' to the real name of a person who uses that
computer (e.g. Smith, Shepard, etc).


The interesting thing is that Environ("username") on every PC returns
'weakuser', not the real name. Is it possible to find the login (Smith
or Shepard or etc.) in VBA?


thanks- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -