Can i change windows registry where wslvar username is stored?

After i renamed my user and its folder $(wslvar USERNAME) still returns old one need help how to change that registry key. I tried unchecking wsl in features and chacking back on but did not helped

Answers 1

  • wslvar USERNAME is looking for the Windows environment variable named USERNAME, so according to this comment with the same situation (rename of user and folder, environment variable not updated), the answer is to:

    • Run netplwiz in Windows
    • Double-click the user account
    • Correct the username there
    • Log out the user and back in

    I haven't tested this myself, of course, but it seems likely that this work, and it's easy enough to try.

Related Questions