Results 1 to 6 of 6

Thread: How do I get the full username?

  1. #1

    Thread Starter
    Addicted Member VB6Coder's Avatar
    Join Date
    Apr 2001
    Location
    Northampton, UK
    Posts
    185

    Question How do I get the full username?

    Hi

    In Microsoft Word if you go into the View\Options dialog and blank the text boxes in the User Information tab, the next time Word will start up, it'll display a dialog box prompting you to put in your name and initials. The Name text box is defaulted to my full name, not my network logon name.

    e.g.
    My Network username is MarkJon

    but the name text box is defaulted to Mark Jones, which is my full name

    I know how to use the GetUserName API to get the Network username (e.g. MarkJon), but how do I get the full name (e.g. Mark Jones).

    Thanks in advance
    Last edited by VB6Coder; Nov 18th, 2002 at 04:31 AM.

  2. #2
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    I think it is stored in the registry somewhere. Perhaps you can find the registry entry if you search your registry on your name.

  3. #3

    Thread Starter
    Addicted Member VB6Coder's Avatar
    Join Date
    Apr 2001
    Location
    Northampton, UK
    Posts
    185
    I've done a search in the registry and my name is all over the place, mainly under install keys.

    Nothing seems to stand out saying this is where I can get the full username.

  4. #4
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    If you are using Win NT or later, you can use the NetUserGetInfo API call. Search the forum for an example.

  5. #5
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    See this link. I think this is where you get the full username.

  6. #6

    Thread Starter
    Addicted Member VB6Coder's Avatar
    Join Date
    Apr 2001
    Location
    Northampton, UK
    Posts
    185

    Thumbs up

    Thanks guys. You were all correct.

    I did a search on NetUserGetInfo and I found this thread which told me where to find the full user information in the registry.

    It is stored in:
    HKEY_CURRENT_USER\Software\Microsoft\MS Setup (ACME)\User Info\DefName

    I tried using the NetUserGetInfo API but it didn't work. Probably because we've got a mixture of NT and NetWare servers here.

    Thanks for all your help

Posting Permissions

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



Click Here to Expand Forum to Full Width