Jump to content

Set your Computer Name unattended...


Recommended Posts

Sorry, I wasn't very clear in my previous post, it was very late... :)

When I tested it, I made a compname.cmd with the exact code you provided, only I changed the mac adress with the mac adress of my nic and I changed the computer name. This is the compname.cmd I tested....

ECHO.
ECHO Setting Computer Name
ECHO Please wait...
for /f "tokens=1" %%i IN ('compname /d ?m') do set MAC=%%i
IF %MAC% == 000C29401163 compname /c TestUnattend

I booted a clean windows xp pro machine and then I manually started the compname.cmd. Then I got the following error:

C:\Install> for /F "tokens=1" %i IN ('compname /d ?m') do set MAC=%i

compname was unexpected at this time.

> was unexpected at this time

> was unexpected at this time

Hope you understand my problem a bit more now..... I haven't got the slightest idea why it worked the first time and now it won't.....

Link to comment
Share on other sites


Ok, the second problem is to automate joining a domain. In the winnt.sif I already chose to join the domain, but the computername isn't correct. So after using compname.exe the computer has to join the domain. First you need a reboot because the computername has changed, then you have to log on again autmatically and then Fase 2 of the automated process has to start. I haven't figured out how to accomplish that, but I'm sure I'll find it here on the forum. The tool you need for joining a domain is NETDOM.exe. It can be found in the XP resource kit.

The full line in the script should be:

netdom add /domain:domainname /userd:User /passwordd:Password

Just in case someone was wondering how to do this (just sharing my findings)

Link to comment
Share on other sites

Hi Bunzzing,

Try this:

Move your compname.cmd to the T-13 stage; run it at the end of your apps.cmd / cmdlines.txt.  Then add your computer to the domain at the end of the GUIRunOnce.cmd.

Can't try it for myself as I don't have a Domain Controller here. Let us know your findings.

Regards,

eNuffSaid

Will give it a try, but won't be till tonight, off to work in a few minutes.....

I'm not quite sure if I understand your explanation because my apps are installed from the GuiRunOnce.cmd. So maybe it's better for me to add the compname.cmd to the cmdlines.txt so that the compname will be changed before the runguionce.cmd. If I'm correct there is a reboot between the execution of the cmdlines.txt and the runguionce.cmd.......

I'll post my findings......

Off to work now :)

Link to comment
Share on other sites

"werk ze"... :)

Bedankt, was weer een zware dag "At the office" en dat meteen na pasen..... :rolleyes:

Ok, enuffsaid, I followed your instructions. This is what I did....

I put cmdlines.txt, compname.exe, regtweaks.reg en SetCompname.cmd in the C:\XPCD\$OEM$ folder

Cmdlines is as follows:

[COMMANDS]

"REGEDIT /S regtweaks.reg"

"SetCompname.cmd"

and SetCompname.cmd is like this:

ECHO.

ECHO Setting Computer Name

ECHO Please wait...

for /f "tokens=1" %%i IN ('compname /d ?m') do set MAC=%%i

IF %MAC% == 000C29401163 compname /c TestUnattend

So during the T-13 fase, setup will look if there's a cmdlines.txt and will execute the commands. First it will import the registry tweaks and then it wil execute the SetCompname.cmd so that it will change te computername, right... ?

Now I only have to create the .iso file and boot my virtual machine with the iso. Hope it works tomorrow, time to go to bed.

Link to comment
Share on other sites

Ok, I tested my unattended install. Installing the applications went perfectly well, changing the computername at stage T-13 also worked perfect and finally creating and joining the domain went perfect.

I added the lines below to the Fase1.cmd file to create an computeraccount in the domain and to join the domain. After the reboot, I had the option to log on as a local user on my workstation, or the option to log on to the domain.

Verified Active Directory Users and Computers on my DC to see wether the computeraccount had been created or not.... and it had been...

ECHO.

ECHO Joining the Domain

ECHO Please wait....

start /wait %systemdrive%\install\netdom add %computername% /domain:yourdomainname.com /userd:adm_join /passwordd:joindomain

start /wait %systemdrive%\install\netdom join %computername% /domain:yourdomainname.com /userd:admjoin /passwordd:joindomain

Enuffsaid, thank you for all your input, you really helped me a lot....

Bedankt man..... :)

Link to comment
Share on other sites

Any ideas on assigning different CD keys via MAC address...

Hmm... not that its any of my business, but why would you want to do that?

Kind regards,

eNuffSaid

Because my company does not use corporate keys, they use action pack keys

5 keys all up and can be activated 5 times each.

Therefore when computer "a" with mac address "assigned" needs a reinstall, the unattended CD always gives the same CD key to that specific computer.

Thats ok?

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...