arp -s静态绑定脚本pc软件 文章资讯 手机软件

您当前的位置→图文中心ARP文章ARP经验arp -s静态绑定脚本

arp -s静态绑定脚本


2008/12/14  编辑:佚名 来源:本站整理  关键词:

arp -s静态绑定脚本

 

Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("temp.bat")
Set objReg = New RegExp
strMacPattern = "((\d|([a-f]|[A-F])){2}-){5}(\d|([a-f]|[A-F])){2}"
strIPPattern = "((2[0-4]\d|25[0-5]|1?\d?\d)\.){3}(2[0-4]\d|25[0-5]|1?\d?\d)"
Set objExec = objShell.Exec("arp -a")
Do
        strTemp = objExec.StdOut.ReadLine
        objReg.Pattern = strMacPattern
        Set arrMac = objReg.Execute(strTemp)
        objReg.Pattern = strIPPattern
        Set arrIP = objReg.Execute(strTemp)
        For Each strMac In arrMac
                For Each strIP In arrIP
                        objFile.WriteLine "arp -s " & strIP & " " & strMac
                Next
        Next
Loop Until objExec.StdOut.AtEndOfStream

objFile.Close

strScriptPath = Replace(WScript.ScriptFullName,WScript.ScriptName,"")

Set objExec = objShell.Exec(strScriptPath & "temp.bat")
Do While objExec.Status = 0
        WScript.Sleep 1000
Loop
objFSO.DeleteFile strScriptPath & "temp.bat"
WScript.Echo "Done!"

相关文章
  • VMware和Virtual PC大比拼
  • aRP的工作原理及高速缓存
  • 基于ARP欺骗的惩罚措施
  • ARP协议的探测原理
  • A Sharper Scaling图片放大不失真软件使用方法
  • 支付宝AR识花是什么,支付宝AR识花玩法介绍
  • 三星I9100连上电脑的Kies,提示"Your device's current firmware version is not supp...
  • flipboard怎么注册 Flipboard注册方法
  • VMware安装CentOS图文教程
  • Spark开箱尝鲜
  • 发表评论
    阅读排行
    相关热门
    网站帮助 - 广告合作 - 下载声明 - 网站地图