2

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

C:\Users\Administrador.ELEKTRO-PC

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

Administrador

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... 
7
  • Have you seen this resource? It may be applicable, or it may give you some new ideas Jul 18, 2013 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. Jul 18, 2013 at 10:21
  • Seems like a job for mklink. Jul 19, 2013 at 0:19
  • 2
    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, 2013 at 21:23
  • 1
    @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, 2013 at 8:15

1 Answer 1

5
+50

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.

0

You must log in to answer this question.

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