G
Guest
I have been using a vbscript in XP to enable/disable network connections that
uses the NAMESPACE method to examine the network control panel ( see code
snippet). However in Vista the network control panel and list of network
devices does not appear to be in the NAMESPACE method any more. The "Network
and Sharing Center" control panel replaced the "Network Connections" in Vista
and the list of connections seems to have disappeared from the namespace
method information. I am sure I am overlooking something simple. Anybody?
Here is a snippet of what I am doing on XP
---snippet-----------------------------------------------------------------------------
Const ssfCONTROLS = 3
sConnectionName = "Local Area Connection"
sEnableVerb = "En&able"
sDisableVerb = "Disa&ble"
set shellApp = createobject("shell.application")
set oControlPanel = shellApp.Namespace(ssfCONTROLS)
set oNetConnections = nothing
for each folderitem in oControlPanel.items
if folderitem.name = "Network Connections" then
set oNetConnections = folderitem.getfolder: exit for
end if
next
if oNetConnections is nothing then
msgbox "Couldn't find 'Network Connections' folder"
wscript.quit
end if
---------------------------------------------------------------------
uses the NAMESPACE method to examine the network control panel ( see code
snippet). However in Vista the network control panel and list of network
devices does not appear to be in the NAMESPACE method any more. The "Network
and Sharing Center" control panel replaced the "Network Connections" in Vista
and the list of connections seems to have disappeared from the namespace
method information. I am sure I am overlooking something simple. Anybody?
Here is a snippet of what I am doing on XP
---snippet-----------------------------------------------------------------------------
Const ssfCONTROLS = 3
sConnectionName = "Local Area Connection"
sEnableVerb = "En&able"
sDisableVerb = "Disa&ble"
set shellApp = createobject("shell.application")
set oControlPanel = shellApp.Namespace(ssfCONTROLS)
set oNetConnections = nothing
for each folderitem in oControlPanel.items
if folderitem.name = "Network Connections" then
set oNetConnections = folderitem.getfolder: exit for
end if
next
if oNetConnections is nothing then
msgbox "Couldn't find 'Network Connections' folder"
wscript.quit
end if
---------------------------------------------------------------------