Results 1 to 7 of 7

Thread: XP Current windows username

  1. #1
    Funking Prink! Raz316's Avatar
    Join Date
    Jul 2003
    Location
    Deal, Kent, UK
    Posts
    2,978
    Thanks
    130
    Thanked
    62 times in 52 posts

    XP Current windows username

    so, there is a user account called 'Bob', I log in as bob and when I type the following into a cmd.exe prompt

    echo %USERNAME%

    I get 'DESKTOP' and it appears the user bob was originally called DESKTOP.

    How do I echo the 'current' username?

    Thanks
    -Chris

  2. #2
    Senior Member
    Join Date
    Feb 2008
    Posts
    914
    Thanks
    4
    Thanked
    155 times in 143 posts
    • smargh's system
      • Motherboard:
      • Gigabyte GA-EP45-UD3P
      • CPU:
      • Xeon E5450 with 775-to-771 Mod
      • Memory:
      • 16GB Crucial
      • Storage:
      • Intel X25-M G2 80GB/Adaptec 3405 4x 2TB Ultrastar RAID1 / 1x 6TB Hitachi He6 / Dying 2TB Samsung
      • Graphics card(s):
      • GTX 750 Ti
      • PSU:
      • Seasonic X-560
      • Case:
      • Lian-Li PC-A71
      • Operating System:
      • Windows 7 Ultimate 64bit
      • Monitor(s):
      • BenQ G2400WD
      • Internet:
      • Really Crap ADSL2 <3Mbit

    Re: XP Current windows username

    Are you sure about that?

    Unless Windows has gotten confused, "DESKTOP" is the username (account name) of the person logged on.

    There is a difference between username and "display name". In the following example (via compmgmt.msc), the user named "user" will appear as "Test" on both the Welcome Screen and the XP non-classic start menu:



    And on the ctrl-alt-delete screen (if not using the welcome screen):


    To make things even more complicated, if a user account is renamed, the "Documents and Settings" (XP) or "Users" (Vista+) folder will still be named after the original username.
    Last edited by smargh; 15-10-2009 at 07:13 PM.

  3. #3
    Senior[ish] Member Singh400's Avatar
    Join Date
    Jun 2008
    Posts
    2,933
    Thanks
    136
    Thanked
    310 times in 247 posts

    Re: XP Current windows username

    Smargh speaks the truth

    My login name is my real name, but my display name is Singh400. When I do echo %USERNAME% my real name pops up

  4. Received thanks from:

    Raz316 (16-10-2009)

  5. #4
    Funking Prink! Raz316's Avatar
    Join Date
    Jul 2003
    Location
    Deal, Kent, UK
    Posts
    2,978
    Thanks
    130
    Thanked
    62 times in 52 posts

    Re: XP Current windows username

    Sorry yeah, that's what I meant. Can I easily get hold of the display name?

  6. #5
    Senior Member
    Join Date
    Jun 2008
    Posts
    1,474
    Thanks
    2
    Thanked
    140 times in 116 posts
    • BobF64's system
      • Motherboard:
      • Asus P8Z77-V Pro
      • CPU:
      • Intel Core i7-3770K
      • Memory:
      • 16GB Corsair XMS3 PC3-12800
      • Storage:
      • Multiple HDD and SSD drives
      • Graphics card(s):
      • ASUS DUAL-GTX1060-06G
      • PSU:
      • 750W Silverstone Strider Gold Evolution
      • Case:
      • Silverstone Fortress FT02
      • Operating System:
      • Windows 10 x64 Pro
      • Monitor(s):
      • HP ZR24w

    Re: XP Current windows username

    If you type "set" in the cmd window, it will show you all the valid console variables, like %USERNAME% etc

    If its not in that list, it probably is if you use VBscript or something else, just not via echo.

  7. Received thanks from:

    Raz316 (16-10-2009)

  8. #6
    Senior[ish] Member Singh400's Avatar
    Join Date
    Jun 2008
    Posts
    2,933
    Thanks
    136
    Thanked
    310 times in 247 posts

    Re: XP Current windows username

    Quote Originally Posted by Raz316 View Post
    Sorry yeah, that's what I meant. Can I easily get hold of the display name?
    What happens if you have a play around in control userpasswords2?

    You can edit the UserName there?

    Be warned though, it might completely break the said account.

  9. #7
    Funking Prink! Raz316's Avatar
    Join Date
    Jul 2003
    Location
    Deal, Kent, UK
    Posts
    2,978
    Thanks
    130
    Thanked
    62 times in 52 posts

    Re: XP Current windows username

    Cheers you two. Basically, I wanted to run a script that connects to a samba share using the current login username (and I didn't want to have to set up an account on the samba server called 'Desktop' or 'worklaptop' and the like).

    In the end though, I did a bit of a work around to get the same thing I wanted. In the startup folder for all users I call a script that runs...

    "%USERPROFILE\My Documents\script.bat"

    and in the script I just specify the username specifically, eg...

    net use s: \\server\share /USER:bob

    not that pretty, but what the hoo, it works

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Windows 7 Family Pack Confirmed
    By Singh400 in forum Software
    Replies: 4
    Last Post: 31-07-2009, 05:25 PM
  2. Replies: 11
    Last Post: 14-07-2009, 10:41 AM
  3. On Windows 7
    By Paul Adams in forum Software
    Replies: 1
    Last Post: 01-06-2009, 11:59 PM
  4. Windows Installation Fatal Error
    By Weng in forum Software
    Replies: 23
    Last Post: 16-10-2004, 02:57 PM
  5. Windows XP Email?
    By joshwa in forum Software
    Replies: 9
    Last Post: 18-01-2004, 09:38 AM

Posting Permissions

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