标题: 求助,如何将本机的IP和MAC地址设为一变量?
[打印本页]
作者: maxfull
时间: 2005-11-5 16:08
标题: 求助,如何将本机的IP和MAC地址设为一变量?
我现在是想这样的,网吧最近常中一些网关欺骗性的病毒,我想如果用批处理得到本机的IP和MAC地址。。基本思路是这样,但有不解的请高手帮忙。。
首先用
IPCONFIG /ALL >A.TXT
得到 A.TXT 如下
Windows IP Configuration
Host Name . . . . . . . . . . . . : USER019
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek RTL8139 Family PCI Fast Ethernet NIC
Physical Address. . . . . . . . . : 00-50-8D-62-48-FF
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.0.200
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 202.101.107.55
202.101.98.55
现在想问的是如何将
IP Address. . . . . . . . . . . . : 192.168.0.200
后面的 192.168.0.200 设为变量1%,将
Physical Address. . . . . . . . . : 00-50-8D-62-48-FF
后面的 00-50-8D-62-48-FF 设为变量2%
最后通过 arp -s 1% 2%
完成批处理。。
作者: ily2013
时间: 2005-11-5 16:38
我也是个菜鸟,可以试试这个方法:把所有ip输出为一个文本ip.txt 把所有mac地址输出为文本mac.txt,然后执行for/f %%i in (ip.txt) do for /f %%j in (mac.txt) do arp -s %%i %%j
以上方法未经证实,但本人尝试编辑密码字典时可行!
作者: 无奈何
时间: 2005-11-5 22:23
在这个链接有和你相似的问题的解答,自己试试能否解决问题。
地址:
http://www.cn-dos.net/forum/viewthread.php?tid=17443&fpage=4