WMIC useraccount is used to rename user accounts from Windows command prompt. Net user supports various user management operations from command prompt, however it does not handle renaming user account.
Do the following steps to rename a user account.
- Open elevated command prompt
- Run the below wmic useraccount command
wmic useraccount where name='currentname' rename newname
Example: To rename the user account ‘xpuser’ as ‘win7user’ we can run the below command.
wmic useraccount where name='xpuser' rename win7user
How to rename administrator account
Using this command we can rename administrator account also. The below command changes the user name from ‘administrator’ to ‘admin.’
wmic useraccount where name='administrator' rename admin
The above wmic commands work on XP, Server 2003, Vista, Windows 7 and Server 2008. On Vista and Windows 7, you need to run the commands from elevated command prompt.