如何用脚本实时启用、禁用网卡
来源:百度知道 编辑:UC知道 时间:2024/05/31 09:37:28
zgzhdmv的回答很强,能不能解释一下呀
我试过了没有反应呀
运行中输入
netsh interface ip set address "连接名称"static 0.0.0.0 0.0.0.0 0.0.0.0 1
最后有一个1,一定要有呀
在“工具”菜单中单击“选项”。
在“选项”对话框中选择“调试”文件夹。
在“调试”文件夹中选择“实时”页。
在“启用这些代码类型的实时调试”框中,选中或清除相关的程序类型:“托管”、“本机”或“脚本”。
要在启用实时调试后禁用它,必须使用管理员特权运行。启用实时调试会设置一个注册表项,需要管理员特权才可以更改该项。
单击“确定”。
复制的wscript 脚本 用了能用
======================================
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