关于自动禁用或启动本地连接

来源:百度知道 编辑:UC知道 时间:2024/05/01 11:01:24
我需要一个可以定时禁用本地连接 让计算机无法上网 然后在某个时间又自动启用的定时计划软件!

因为我个人在某个时间段不在 但是需要断线操作 和开启操作。

能帮忙的朋友加油啊!

把下面的复制保存为一个VBS文件,用个定时软件运行它(已经验证可以用)

Const ssfCONTROLS = 3
sConnectionName = "本地连接" '可改成需要控制的连接名称,如"无线网络连接"等
sEnableVerb = "启用(&A)"
sDisableVerb = "停用(&B)" 'XP系统中应为 "停用(&B)"
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 "未找到网络连接文档夹"
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 no