Inside Man
Inside Man

Reputation: 4305

changing UserAccount Name Using Command Prompt

How to change user account name using command prompt in win7? Maybe you tell me that it can be find easily by googling, but I searched and I did not find any working command.

Here is a command which seems to work, but unfortunately it is not working :(

wmic UserAccount where Name="OLDName" call Rename Name="NEWName" 

Upvotes: 0

Views: 2305

Answers (2)

Belter
Belter

Reputation: 3837

When I use this command line directly in PowerShell (Administrator), I got the following error:

PS C:\WINDOWS\system32> wmic useraccount where name="OLD" rename NEW
ERROR:
Description = Invalid query

But I called it successfully when I entered into wmic:

PS C:\WINDOWS\system32> wmic
wmic:root\cli>useraccount where name="OLD" rename NEW

Upvotes: 1

Scott C
Scott C

Reputation: 1660

Shouldn't it just be:

wmic UserAccount where Name="OLDName" Rename "NEWName"

Upvotes: 1

Related Questions