Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I log for first time in Windows 8 this is my user folder:


The computername is appended to the username (lol), but the real username is this:


I have many scripts wich works with "%username%" environment variable instead "%userprofile%", and I can't and I won't change them.

I need to modify IN A SILENT WAY this Windows 8 dissaster to return the correct name to my user folder name, how I can do it?

I'm looking for the way to do it in a silent/unatended way 'cause I need to do it for a unatended installation of windows 8, so I can't manually create a account to restart to log in other account or strange things.

I hope this can be done with some instructions in a batch or vbs script to run the script at the post-installation part of a Windows 8 installation...

PS: I saw in related questions that sometimes the user fodler name is "C:\Users\Username_000" but is not in my case so no matter.

So... If can be done with a script then I can imagine which would be the first instructions in a pseudo way:

Dim Username     as string = expand_variable(%username%)     -> (Administrador)
Dim ComputerName as string = expand_variable(%Computername%) -> (ELEKTRO-PC)
Dim FolderName   as string = expand_variable(%userprofile%).substring.lastindexof("\") -> (Administrador.ELEKTRO-PC)

' Now we have the correct user name to rename the folder, 
' but now what is the next step to do? to let windows to rename the userfolder... 
share|improve this question
Have you seen this resource? It may be applicable, or it may give you some new ideas – Raystafarian Jul 18 '13 at 9:23
@Raystafarian thanks for your comment but that documentation don't gives me any idea (maybe i'm not so perspicious) the example is only to customize the "default" proile content, which I don't notice any relativity with my intentions, but really thanks for suggesting. – ElektroStudios Jul 18 '13 at 10:21
Seems like a job for mklink. – Scott Jul 19 '13 at 0:19
In case you might want to know why this is happening. If the system thinks the user has never logged in before and therefore doesn't have an existing profile directory, it will create a new one. First it will try a folder with the same name as the user (e.g. "Sam"). If it already exists it will try appending a .computer name or domain name. Subsequently, numbers are appended to create a unique name. – user555 Jul 21 '13 at 21:23
@lornix It's not misspelled. Every version of Windows 8 has it's admin account spelled according to the installed language version. "Administrador" being spanish or portuguese in this case. – user555 Jul 25 '13 at 8:15
up vote 5 down vote accepted

If renaming the profile becomes too much hassle or isn't possible, you can instead use mklink create an NTFS junction point at the expected path that redirects to the actual path:

mklink /J C:\Users\Administrador C:\Users\Administrador.ELEKTRO-PC

You will then see what looks like a directory named "C:\Users\Administrador". When you look inside it, you will see the contents of the Administrador.ELEKTRO-PC directory.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .