Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista General

Vista - How to update value of SystemInformation.UserName in Vista

Reply
 
Old 10-21-2007   #1 (permalink)
Dean Slindee


 
 

How to update value of SystemInformation.UserName in Vista

When I loaded Vista it appears that I entered my FirstName/LastName in one
of the setup parameters. So, when I launch an application that I have
written and get the value in SystemInformation.UserName, the value returned
is "SLINDEED\Dean Slindee". What I want to be returned is
"SLINDEED\dslindee". "dslindee" is the value that shows on the startup
screen, and is also the administrator account. How can I change "Dean
Slindee" to "dslindee"?

Thanks,
Dean S


My System SpecsSystem Spec
Old 10-22-2007   #2 (permalink)
Andrew McLaren


 
 

Re: How to update value of SystemInformation.UserName in Vista

"Dean Slindee" <slindee@xxxxxx> wrote ...
Quote:

> When I loaded Vista it appears that I entered my FirstName/LastName in one
> of the setup parameters. So, when I launch an application that I have
> written and get the value in SystemInformation.UserName, the value
> returned is "SLINDEED\Dean Slindee". What I want to be returned is
> "SLINDEED\dslindee". "dslindee" is the value that shows on the startup
> screen, and is also the administrator account. How can I change "Dean
> Slindee" to "dslindee"?

Hi Dean,

It sounds like you have the Account Name and the Full Name back-to-front.
In a normal scenario, user Fred Smith will have Account Name "fsmith" and
Full Name "Fred Smith". When Fred Smith calls SystemInformation.UserName, it
would return "fsmith" - the Account Name (not the Full Name).

In your case, it sounds like you have account name "Dean Slindee" and Full
Name "dslindee".

Local accounts are a bit weird, coz you don't have the full ADSI/LDAP
apparatus. But I think you can change this pretty easily in Administrative
Tools, Computer Management. In the Computer Management snap-in, go to Local
Users and Groups, Users, and locate "Dean Slindee" in the Name column.
You'll probably see in the Full Name column "dslindee".

Right click the account record and choose "Rename". Change "Dean Slindee" to
"dslindee". Optionally, you might choose to change the Full Name "dslindee"
to "Dean Slindee" ... but that has no effect on the value returned by
SystemInformation.UserName.

SystemInformation.UserName generally returns just the user's name (ie
account name), not the full LanMan-style DOMAIN\user formatted name. For
that, you may need to get the SystemInformation.UserDomainName property,
then catenate the string with a "\" in the middle.

Hope it helps,

--
Andrew McLaren
amclar (at) optusnet dot com dot au


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Vista login "incorrect username or password" with correct username and password entry Vista General
vista username on start menu Vista General
Vista keeps asking me for Username/Password Browsers & Mail
Vista, Username Vista General
Vista Upgrade - don't know password or username Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46