none
Changing %username% variable RRS feed

  • Question

  • Hello.

    I changed a users local username at a request due to a bug with Java not being able to handle "Admin!" as a username. The username was changed to "Admin" and the folder was renamed (registry was changed to reflect this new path). However, despite renaming the user on Control Panel and the above, Windows still spits back %username% with "Admin!". Is there any way to change this?

    Thanks,

    Chris.

    Friday, January 27, 2017 12:47 AM

Answers

  • Hello all,

    I've resolved this issue. For those experiencing this issue, doing the following will ensure it is fixed.

    Launch Command Prompt -> echo %username% and ensure it's the incorrect/old username. 

    In command prompt or Windows Run Dialogue, access netplwiz and locate the account. Click "Properties" and change the Username portion to the correct username.

    Click Apply/OK and log out and back in. Windows will correct the %username%. This can be verified by repeating the first step of checking command prompt.

    Thanks everyone!

    Chris.

    • Marked as answer by CFischer_Dev Friday, January 27, 2017 12:57 AM
    Friday, January 27, 2017 12:57 AM

All replies

  • Hello all,

    I've resolved this issue. For those experiencing this issue, doing the following will ensure it is fixed.

    Launch Command Prompt -> echo %username% and ensure it's the incorrect/old username. 

    In command prompt or Windows Run Dialogue, access netplwiz and locate the account. Click "Properties" and change the Username portion to the correct username.

    Click Apply/OK and log out and back in. Windows will correct the %username%. This can be verified by repeating the first step of checking command prompt.

    Thanks everyone!

    Chris.

    • Marked as answer by CFischer_Dev Friday, January 27, 2017 12:57 AM
    Friday, January 27, 2017 12:57 AM
  • Thanks for your sharing on this issue, this could be definitely helpful for other community members who has similare issue as yours. 

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, January 30, 2017 4:31 PM
    Owner