PC Review


Reply
Thread Tools Rate Thread

How to change computername

 
 
Matte
Guest
Posts: n/a
 
      15th Jul 2005
Hello.

As the topic says how if its possible to change the computername in a batch
file?

Any info or help is greatly appreciate.


 
Reply With Quote
 
 
 
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a
 
      15th Jul 2005
Matte wrote:

> Hello.
>
> As the topic says how if its possible to change the computername
> in a batch file?
>
> Any info or help is greatly appreciate.

Hi,

Changing the computer name with the free command line utility
compname.exe is an option:

http://www.willowhayes.co.uk/download/compname.exe

Subject: Setting computer name at command prompt from SMBIOS (asset
tag) info
Date: Thu, 17 Oct 2002 23:16:32 +0100
From: "Oli Restorick" <(E-Mail Removed)>

<quote>
I'm reposting this, because looking at the log files for my web site,
it is clear that quite a few people tried to download the file but,
due to problems with my web host, the download didn't happen.

That should now be fixed. Meanwhile, I've made quite a few updates to
the program.

Compname.exe is a utility to generate a computer name to your
specifications, optionally pulling in data including asset tag/serial
number from the chassis, motherboard and system, System UUID/GUID, mac
address, IP address octets, date, and a random element.

The program should run fine on all Windows platforms since Windows 95,
including Windows NT. If available (i.e 2000, XP, .net) the program
will call SetComputerNameExA from kernel32.dll. If this function is
not available, it calls SetComputerNameA from the same DLL. This
ensures that, for 2000 and above, the DNS host name and the NetBIOS
name both get set properly.

Download the utility and type "compname.exe /?" to get the syntax.
It's pretty easy.

For example,

"compname.exe /c jupiter" sets the computer name to jupiter
"compname.exe /c PC-?k-?l" will use the IP address. If the IP address
is 192.168.1.100, the name will be "PC-1-100"
"compname.exe /c pc-?s" sets the machine to "pc-abcdef" where abcdef
is the SMBIOS asset tag/serial number.
"compname.exe /c pc-?9" generates a name including nine random
characters.

The program can also be used for reading any of these fields (by using
the /d[isplay] option), or for piping these numbers into other
applications.

"compname.exe /s" will give you a summary of the SMBIOS, IP and MAC
information.

Any comments, bug reports or suggestions for improvements are very
welcome.

</quote>





--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
 
Reply With Quote
 
Oli Restorick [MVP]
Guest
Posts: n/a
 
      17th Jul 2005
Thanks, Torgeir. :-)

I'd just like to add that this command should not be run on a machine that
is a domain member (unless rejoining the domain by script is an option),
since domain membership gets broken with the rename. The netdom.exe command
is great for scripting a domain join.

Cheers

Oli


"Torgeir Bakken (MVP)" <Torgeir.Bakken-(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Matte wrote:
>
>> Hello.
>>
>> As the topic says how if its possible to change the computername
>> in a batch file?
>>
>> Any info or help is greatly appreciate.

> Hi,
>
> Changing the computer name with the free command line utility
> compname.exe is an option:
>
> http://www.willowhayes.co.uk/download/compname.exe
>
> Subject: Setting computer name at command prompt from SMBIOS (asset
> tag) info
> Date: Thu, 17 Oct 2002 23:16:32 +0100
> From: "Oli Restorick" <(E-Mail Removed)>
>
> <quote>
> I'm reposting this, because looking at the log files for my web site,
> it is clear that quite a few people tried to download the file but,
> due to problems with my web host, the download didn't happen.
>
> That should now be fixed. Meanwhile, I've made quite a few updates to
> the program.
>
> Compname.exe is a utility to generate a computer name to your
> specifications, optionally pulling in data including asset tag/serial
> number from the chassis, motherboard and system, System UUID/GUID, mac
> address, IP address octets, date, and a random element.
>
> The program should run fine on all Windows platforms since Windows 95,
> including Windows NT. If available (i.e 2000, XP, .net) the program
> will call SetComputerNameExA from kernel32.dll. If this function is
> not available, it calls SetComputerNameA from the same DLL. This
> ensures that, for 2000 and above, the DNS host name and the NetBIOS
> name both get set properly.
>
> Download the utility and type "compname.exe /?" to get the syntax.
> It's pretty easy.
>
> For example,
>
> "compname.exe /c jupiter" sets the computer name to jupiter
> "compname.exe /c PC-?k-?l" will use the IP address. If the IP address
> is 192.168.1.100, the name will be "PC-1-100"
> "compname.exe /c pc-?s" sets the machine to "pc-abcdef" where abcdef
> is the SMBIOS asset tag/serial number.
> "compname.exe /c pc-?9" generates a name including nine random
> characters.
>
> The program can also be used for reading any of these fields (by using
> the /d[isplay] option), or for piping these numbers into other
> applications.
>
> "compname.exe /s" will give you a summary of the SMBIOS, IP and MAC
> information.
>
> Any comments, bug reports or suggestions for improvements are very
> welcome.
>
> </quote>
>
>
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scr...r/default.mspx



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserName vs. ComputerName. How to change? Windows XP General 3 4th Dec 2007 06:30 PM
How do you use SysPrep to ONLY change SID and Computername on template PC? Trevor Windows XP General 2 30th Sep 2006 02:10 AM
Cannot change computername on W2K PC connecting to W2K Server Angus Comber Microsoft Windows 2000 5 18th Jan 2006 04:58 PM
Change ComputerName and WorkGroup name for XP JimmyJam Freeware 5 30th Oct 2005 06:25 PM
Change computername Richard Boezerooij Microsoft Windows 2000 Setup 2 24th Feb 2004 11:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:45 PM.