'编程控制网卡启用停用vbs版
来源:attilax的专栏
地址:http://blog.csdn.net/attilax
Const ssfCONTROLS = 3
sConnectionName = "mecr" '可改成需要控制的连接名称,如"无线网络连接"等
sEnableVerb = "启用(&A)"
sDisableVerb = "停用(&B)" '非xp 系统可能 是禁用
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
msgbox "未找到网络连接文件夹"
ws