Jump to content

Set your Computer Name unattended...


Recommended Posts


Would setting the computer names uniquely be possible using the Setup Manager utility? The unattended install I have created runs completely off CD and I am have used Setup manager to setup my WINNT.SIF file. In it, I have specified 3 machine names that will more than likely never change and will always be used on the same PC's. Has anyone used this process to specify machine names? If so, how would this work using a UA CD and will this work in the same manner as used earlier in this thread?

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...

I apologize if this has been covered elsewhere in the forums but I have been unable to find any other threads regarding this issue. I have been using compname to set my computernames based on the MAC address for Windows 2000 server and XP. They have been working fine. Here is an example of what I am using

cmdow @ /HID
ECHO.
ECHO Setting Computer Name
ECHO Please wait...
for /f "tokens=1" %%i IN ('compname /d ?m') do set MAC=%%i
IF %MAC% == 000000000000 compname /c apollo
IF %MAC% == 000000000001 compname /c cratos

The problem I am having is that this does not seem to work at all under Windows Server 2003. I have manually run this and I keep getting the error

"compname was unexpected at this time"

Any ideas why this will not run on Windows Server 2003?

Link to comment
Share on other sites

Thanks for the links, but that does not allow me to use the MAC to set the computername. Plus, I don't really know VB so I am at a dissadvantage when trying to change it to suit my needs if it supported MAC addresses. Anyone else have anymore ideas as to why this won't work under Windows Server 2003?

Link to comment
Share on other sites

compname was unexpected at this time

OK, time to come out of the lurking closet. :P (first post)

Try it with only 1 %. The error is exactly the same as the one you get when you try it on CMD line in XP.

After some googling, I found that %%i is to be used in a batch and only one % via CMD line.

To test the batch itself, just rem the cmdow and put some pauses and echos in to see which parts run and which don't.

Link to comment
Share on other sites

Thanks for the links, but that does not allow me to use the MAC to set the computername.

What exactly do you want it do do ?

I use a csv that I exported from excel that lists the serial numbers and associated computernames. You can go tru MAC instead of SN if you wish.

I look up the matching computername via batch.

Link to comment
Share on other sites

Have you run this during an unattended setup? I just tried running it again after editing it yo use a single % instead of a double and it did not change the server name. I can run this same exact .cmd file on Windows 2000 Server without issue, but Windows 2003 seems to not want to execute this for some reason. Now I just edited the file and ran it from a command prompt and it runs without error, with double %'s, but does not change the server name.

This is what the .cmd file looks like

cmdow @ /HID
ECHO.
ECHO Setting Computer Name
ECHO Please wait...
for /f "tokens=1" %i IN ("compname /d ?m") do set MAC=%i
IF %MAC% == 000000000000 compname /c apollo
IF %MAC% == 000000000000 compname /c cratos
IF %MAC% == 000000000000 compname /c cyclops
IF %MAC% == 000000000000 compname /c delphi
IF %MAC% == 000000000000 compname /c janus
IF %MAC% == 000000000000 compname /c mars
IF %MAC% == 000000000000 compname /c mercury
IF %MAC% == 000000000000 compname /c neptune
IF %MAC% == 000000000000 compname /c nereid
IF %MAC% == 000000000000 compname /c neti
IF %MAC% == 000000000000 compname /c odyssey
IF %MAC% == 000000000000 compname /c pallas
IF %MAC% == 000000000000 compname /c pluto
EXIT

Link to comment
Share on other sites

Have you run this during an unattended setup?

This is what the .cmd file looks like

...

Yes, it's run during attended setup, but via RunOnce.

Not to sound patronising, but is that batchfile exactly what you use ? Or do you have real mac-addresses in the "real world" ?

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