How to change a Windows username using the command prompt?

You can use wmic for this. The command is:

wmic useraccount where name='currentname' rename newname

Example, if your username is "user" and you want to rename to "person" the following command would be used.

wmic useraccount where name='user' rename person

Please note, you need administrative privileges to use this command, so make sure you start your command prompt using run as administrator.

EDIT: suddenly you mention in the comments that you do NOT want to change the Username, but the Full Name instead.

The command for that is here:

wmic useraccount where fullname='currentname' rename newname

You can substitute fullname or name for any of the following:

AccountType  Description  Disabled  Domain    FullName     InstallDate  LocalAccount  Lockout  Name   PasswordChangeable  PasswordExpires  PasswordRequired  SID  SIDType  Status

You can use the following command to see a list of all users with all their settings:

wmic useraccount list

The following will do what you want:

net user JDoe /fullname:"John Doe"