PC Review


Reply
Thread Tools Rate Thread

NIC Enumeration ?

 
 
Ralph
Guest
Posts: n/a
 
      28th Jun 2007
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
 
 
 
 
K
Guest
Posts: n/a
 
      29th Jun 2007
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

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
Enumeration shapper Microsoft ASP .NET 0 13th Oct 2008 02:14 PM
Enumeration shapper Microsoft ASP .NET 2 13th Jan 2007 01:35 PM
passing enumeration parameter to generic (all enumeration) sub JackRazz Microsoft C# .NET 8 30th Mar 2004 09:10 PM
passing enumeration parameter to generic (all enumeration) sub JackRazz Microsoft VB .NET 8 30th Mar 2004 09:10 PM
Re: NIC enumeration Ryan Rogers Microsoft C# .NET 0 23rd Mar 2004 07:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:02 AM.