Jump to content

Use computer name as Username


Recommended Posts

So I have this CD for 3 of my computers, and everything is unattended except filling out the Computer name. Which in my house is always the name of the user that will be using it. But at the end of the installation it's always an Adminstrator account. Is there any way to grab the computer name and use it as a user name and create a user automatically?

Link to comment
Share on other sites


Well, when I put a computer name in the dialog box, it takes that name and adds in a few random numbers(?) and creates a computer name. Anyway to get the name entered by the user and use that as a user account?

Link to comment
Share on other sites

Hi Grake,

You could use my script to execute during first administrator login (if you enable one autologin):

net user /add %computername%
net localgroup administrators %computername% /add

This will create a new user with the name of the computer and without a password.

NOTICE! If your using a non-english version of Windows you need to change the "administrators" to the correct name. For example I am using the danish version where the name is "Administratorer".

You can get a list of groups on your PC using this from a command prompt:

net localgroup

Link to comment
Share on other sites

There are a couple of different ways I use to change the computer name, and make the name of the PC the same. The draw back is that your CD wont be unattended anymore. On the Plus side, you can use your unattended CD (or DVD) on any system, and not have to worry about making changes after everything is installed. :D

Please note that both of these programs are ones I've gotten from these message boards.

The first is called UserAcc.exe and is run from cmdlines.txt. At about stage T39 in Windows setup, a prompt will come up asking for a Username for the PC. You can find this program from here...

The second portion of your request (renaming the PC to the name of the user logged on) is a program called WSName.exe. You can find that program right here.

Here is the code I run from RunonceEX.cmd to change the name to the PC name.

REG ADD %KEY%\005 /VE /D "Setting the PC name to your username" /f
REG ADD %KEY%\005 /V 1 /D "%systemdrive%\Install\Applications\WSName\WSName.exe /N:%USERID" /f

Finally there is a program called Wiscon (again, someone on these boards came up with it), that will change the username, PC name, and even allow an additional user to be created. I run it from RunonceEx.cmd with this code...

REG ADD %KEY%\097 /VE /D "Windows Initial System CONfigurator" /f
REG ADD %KEY%\097 /V 1 /D "%systemdrive%\Install\Applications\Wiscon\WISCON.exe" /f

I like Wison, as it allows a little more customization (can change the workgroup name), and the addition of an extra user if needed. You can read about Wiscon from here.

Edited by Powerhouse
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...