管理网卡vbs脚本
管理网卡vbs脚本
发布时间:2016-12-28 来源:查字典编辑
摘要:'dislan.vbs'usage:cscript/nologodislan.vbsConstssfCONTROLS=3sConnectio...

'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

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新vbs学习
热门vbs学习
脚本专栏子分类