- 帖子
- 23
- 积分
- 198
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2007-12-20
|
3楼
发表于 2008-3-18 14:56
| 只看该作者
这是在我本机上测试通过的代码,参考下
StrComputer = "."
MyMac = "E0:0C:20:52:41:53"
set ObjMAC =GetObject("Winmgmts:\\" & StrComputer & "\Root\Cimv2")
Set ObjMacs = ObjMac.instancesof("Win32_NetworkAdapterConfiguration")
for each objmac in ObjMacs
If MyMac = Objmac.MACAddress Then
set s = WScript.CreateObject("WScript.Shell") '创建WScript.Shell对象
s.Run "c:\1.txt"
end if
next |
|