PC Review Forums Newsgroups Windows XP Windows XP Embedded NIC Enumeration ?

Reply

NIC Enumeration ?

 
Thread Tools Rate Thread
Old 28-06-2007, 09:09 PM   #1
Ralph
Guest
 
Posts: n/a
Default NIC Enumeration ?


I have the script below I am using to rename a network adapter after
resealing a system. All of the computer's hardware is supposed to be
the same but when the cloned image is installed it will sometimes
enumerate the NIC as a new device. I want to rename the nic to
"INTERNET" and set the IP after it reseals so when it reboots and
enumerates the new devices are configured per below. Problem is that
sometimes the new NIC is labeled "Local Area Connection 2" and the
script fails. Is there a way to get netsh to check for the name or
add a wildcard? I tried "*" but that too did not correctly ID the
device.

Thanks,

REB

@Echo off
Title XP Embedded UIC Post Reseal Configuration Utility.
Color 1F
cls

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:
: :
: Description: Automated script designed to configure the local network adapter with an IP :
: address of 192.168.1.1 with Subnet Mask 255.255.255.0. Additionally the script should rename :
: the connection to "Internet". : :
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:Rename adapter to "ToMMC"
Echo Renaming local network connection from Local Area Connection to
"Internet"...
netsh interface set interface name="Local Area Connection"
newname="Internet"

:Set the IP address to "192.168.1.1" with subnet of 255.255.255.0.
Echo Setting IP address to 192.168.5.3...
netsh interface ip set address "Internet" static 192.168.1.1
255.255.255.0 192.168.1.1 1
  Reply With Quote
Old 29-06-2007, 12:21 AM   #2
K
Guest
 
Posts: n/a
Default Re: NIC Enumeration ?

Ralph,

You can use the following VBScript to enumerate the network
connections

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(NETWORK_CONNECTIONS)

Set colItems = objFolder.Items
' Goes through every connection, etc.
For Each objItem in colItem
'set the name, ala: objItem.Name = "INTERNET"
Next

Kris

On Jun 28, 3:09 pm, (Ralph) wrote:
> I have the script below I am using to rename a network adapter after
> resealing a system. All of the computer's hardware is supposed to be
> the same but when the cloned image is installed it will sometimes
> enumerate the NIC as a new device. I want to rename the nic to
> "INTERNET" and set the IP after it reseals so when it reboots and
> enumerates the new devices are configured per below. Problem is that
> sometimes the new NIC is labeled "Local Area Connection 2" and the
> script fails. Is there a way to get netsh to check for the name or
> add a wildcard? I tried "*" but that too did not correctly ID the
> device.
>
> Thanks,
>
> REB
>
> @Echo off
> Title XP Embedded UIC Post Reseal Configuration Utility.
> Color 1F
> cls
>
> ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>
> :
> : :
> : Description: Automated script designed to configure the local network adapter with an IP :
> : address of 192.168.1.1 with Subnet Mask 255.255.255.0. Additionally the script should rename :
> : the connection to "Internet". : :
> ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>
> :Rename adapter to "ToMMC"
> Echo Renaming local network connection from Local Area Connection to
> "Internet"...
> netsh interface set interface name="Local Area Connection"
> newname="Internet"
>
> :Set the IP address to "192.168.1.1" with subnet of 255.255.255.0.
> Echo Setting IP address to 192.168.5.3...
> netsh interface ip set address "Internet" static 192.168.1.1
> 255.255.255.0 192.168.1.1 1



  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off