'dislan.vbs
'usage:cscript/nologodislan.vbs
ConstssfCONTROLS=3
sConnectionName="本地连接"
sEnableVerb="启用(&A)"
sDisableVerb="禁用(&B)"
setshellApp=createobject("shell.application")
setoControlPanel=shellApp.Namespace(ssfCONTROLS)
setoNetConnections=nothing
foreachfolderiteminoControlPanel.items
iffolderitem.name="网络和拨号连接"then
setoNetConnections=folderitem.getfolder:exitfor
endif
next
ifoNetConnectionsisnothingthen
wscript.quit
endif
setoLanConnection=nothing
foreachfolderiteminoNetConnections.items
iflcase(folderitem.name)=lcase(sConnectionName)then
setoLanConnection=folderitem:exitfor
endif
next
ifoLanConnectionisnothingthen
wscript.quit
endif
bEnabled=true
setoEnableVerb=nothing
setoDisableVerb=nothing
s="Verbs:"&vbcrlf
foreachverbinoLanConnection.verbs
s=s&vbcrlf&verb.name
ifverb.name=sEnableVerbthen
setoEnableVerb=verb
bEnabled=false
endif
ifverb.name=sDisableVerbthen
setoDisableVerb=verb
endif
next
ifbEnabledthen
oDisableVerb.DoIt
else
oEnableVerb.DoIt
endif
wscript.sleep1000