set shellApp = createobject("shell.application") set oControlPanel = shellApp.Namespace(ssfCONTROLS)
set oNetConnections = nothing for each folderitem in oControlPanel.items if folderitem.name = "网络和拨号连接" then set oNetConnections = folderitem.getfolder: exit for end if next
if oNetConnections is nothing then wscript.quit end if
set oLanConnection = nothing for each folderitem in oNetConnections.items if lcase(folderitem.name) = lcase(sConnectionName) then set oLanConnection = folderitem: exit for end if next
if oLanConnection is nothing then wscript.quit end if
bEnabled = true set oEnableVerb = nothing set oDisableVerb = nothing