修改 Gateway和DNS的vbs脚本
Const T_GATEWAY = "1.1.1.1" '网关
Const T_NEWDNS1 = "2.2.2.2" 'DNS1
Const T_NEWDNS2 = "3.3.3.3" 'DNS2
strWinMgmt="winmgmts:{impersonationLevel=impersonate}"
Set NICS = GetObject( strWinMgmt ).InstancesOf("Win32_NetworkAdapterConfiguration")
For Each NIC In NICS
If NIC.IPEnabled Then
NIC.SetDNSServerSearchOrder Array(T_NEWDNS1,T_NEWDNS2)
NIC.SetGateways Array(T_GATEWAY)
End If
Next
无须重新启动,不管系统语言
VBS sendkeys 模拟击键操作 问题解决
'======================================'VBS中SendKeys模拟键盘击键'2009-07-26'刘林'======================================DimWshShellSetWshShell=WScript.CreateObject("WScript.Shell")WshShell.Ru
用vbscript来添加ip策略 自动封IP
程序主要是读取这个网站的iis日志,分析出其中的IP地址,用安全策略自动封闭。VBS代码如下:'代码开始Setfileobj=CreateObject("Scripting.filesystemobject")logfilepa
vbs,hta中选择文件夹对话框实现代码
onerrorresumenextSelectFolderfunctionSelectFolder()ConstMY_COMPUTER=&H11&ConstWINDOW_HANDLE=0ConstOPTIONS=0SetobjShell=CreateObject("Shell.Application")SetobjFolder=objShell.Namespace(MY_COMPUTER)Seto
编辑:一起学习网
标签:代码,击键,网关,重新启动,对话框