我想找出远程交换机内mac地址,并且将mac地址打印出来保存。- @echo off
- start telnet
- echo set sh=WScript.CreateObject("WScript.Shell)>telnet_tmp.vbs
- echo WScript.Sleep 300>>telnet_tmp.vbs
- echo sh.SendKeys"open 192.168.1.1{ENTER}">>telnet_tmp.vbs
- echo WScript.Sleep 300>>telnet_tmp.vbs
- echo sh.SendKeys"admin{ENTER}">>telnet_tmp.vbs
- echo WScript.Sleep 300>>telnet_tmp.vbs
- echo sh.SendKeys"admin{ENTER}">>telnet_tmp.vbs
- echo WScript.Sleep 300>>telnet_tmp.vbs
- for /f %%i in (报警主机IP.txt) do echo sh.SendKeys"dis arp %%i{ENTER}">>MAC.txt>>telnet_tmp.vbs
- cscript//nologo telnet_tmp.vbs
- del telnet_tmp.vbs
- pause
复制代码 目前存在的问题是,所有的mac地址都能在cmd里面显示出来,但是保存到mac.txt中有问题,求大神指导 |