Prev Previous Post   Next Post Next

vbscript to enable network connections

Posted: 11-27-2006, 02:29 PM
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
---------------------------------------------------------------------
Reply With Quote

Responses to "vbscript to enable network connections"

 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may 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 On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I BYPASS system startup and enable connections to internet using VISTA home? Guest Windows Vista 0 09-04-2008 04:44 AM
Network Connections not displaying any connections psychme Windows XP Network & Web 2 01-02-2004 09:12 PM
>My Network Connections window does not have anything called Incoming Connections lhd_5113 Windows XP Network & Web 1 11-26-2003 08:08 AM
Why can't I find Incoming connections in My Network Connections? NormC Windows XP Network & Web 1 11-24-2003 02:57 AM
script disable/enable local area connections Tony Windows XP Network & Web 1 07-13-2003 04:58 PM