I am trying to automate ms loopback adapter install and was able to automate the install fine using DevCon.exe.

devcon install C:\Windows\inf\netloop.inf *MSLOOP

now this works fine. After installation I would like to configure the adapter and I was able to do this with little problems as long as I know that the adapters name is going to be "Local Area Connection 2" using the NetSh.exe.

netsh interface ip show address name="Local Area Connection 2"
alright, now we are getting somewhere. But and this is a big but... I immmediatley thought what if one of our users decided to install a wireless card or some other networking device that already took the name "Local Area Connection 2" ? This will break the config portion for those particular users. No problem i thought I can just throw a quick reg hack in and rename it there. Another problem. The regkey contains what appears to be a random GUID as shown here:

"Name"="MS Loopback Adapter"

The {4D36E972-E325-11CE-BFC1-08002BE10318} is consistent, but the second guid appears to just be randomly generated.

So does anyone here have any ideas of how I can rename this connection to say "MS Loopback Adapter" so I can run the NetSh command with a unique identifier?

Any ideas or thoughts would be greatly appreciated!!!


0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


Maybe you can include a vbscript in a custom action to check the last "objNicConfig.Index" as it would be the newest network interface. You could then use vbscript to execute a shell command referencing the 'objNicConfig.Description'.

I am on a boring support call and browsing the appdeploy forums right now. I appologize if this answer seems half baked... [;)]

VBScript to look at interfaces

On Error Resume Next

dim theMessage

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNicConfigs = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration")

For Each objNicConfig In colNicConfigs
theMessage = theMessage & vbcrlf & "Network Adapter " & objNicConfig.Index & " (" & objNicConfig.Description & ")"
theMessage = theMessage & vbcrlf & " IP Address(es):"
For Each strIPAddress In objNicConfig.IPAddress
theMessage = theMessage & vbcrlf & " " & strIPAddress

theMessage = theMessage & vbcrlf & " Subnet Mask(s):"
For Each strIPSubnet In objNicConfig.IPSubnet
theMessage = theMessage & vbcrlf & " " & strIPSubnet

wscript.echo theMessage
Answered 07/20/2005 by: Garrett
Orange Belt

Please log in to comment
thanks garret, this helped me get through the problem.

here is what i used.

Set WshShell=Wscript.CreateObject("Wscript.shell")
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(NETWORK_CONNECTIONS)
Set objFolderItem = objFolder.Self
Wscript.Echo objFolderItem.Path

Set colItems = objFolder.Items
LastCnt = colItems.Count
LastOne = colItems.Item(LastCnt-1).Name
Wscript.Echo "Last name is " & LastOne

WshShell.run "netsh interface ip set address name=" & Chr(34) & LastOne & Chr(34) & " source=static"

thanks again!!
Answered 07/21/2005 by: indica
Yellow Belt

Please log in to comment
Hello everybody!

Ok - indica's asked the question is some time ago <g> - today i tried to do the same thing. I found an IMHO fine solution in the "Hey, Scripting Guy" article from 2005-05-11. You can read this article at


Hope this will be useful for somebody out there ...

Have a fine time ...


PS: the answer is 42!
Answered 02/22/2007 by: MrWinstonWolf
Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity