Rename Account in Windows

In Windows XP and probably NT / 2K / 2K3, when you rename an account in the Control Panel, it actually only changes the display name.

To really rename the account, you either use a program, or you can use this script:

http://www.microsoft.com/technet/scriptcenter/resources/qanda/may06/hey0517.mspx

Copy the bits and make sure to change the hardcoded account names.  Save the file as a ".vbs" script.  They probably made this hard to do because it does affect things unexpectantly, I think.

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colAccounts = objWMIService.ExecQuery _
("Select * From Win32_UserAccount Where LocalAccount = True And Name = 'kmyer'")

For Each objAccount in colAccounts
objAccount.Rename "kenmyer"
Next

Tags: script, account, name, rename, vbscript, winxp, user
Related Scribbles:
  • Windows XP Notes


  • ID: 818
    Author:
    leonard
    Date Updated:
    2008-10-17 13:57:08
    Date Created:
    2007-02-08 16:03:44

    Edit

    Comments?
     >> Leonard Chan's Homepage  >> Scribble Web  >> Rename Account in Windows
    leonard.lotus-land.ca is hosted by Perceptus Solutions Inc.