StrComputer = "."
MyMac = 00-19-E0-23-08-FF
set ObjMAC =GetObject("Winmgmts:\\" & StrComputer & "\Root\Cimv2")
Set ObjMacs = ObjMac.get("Win32_NetworkAdapterConfiguration.index=1")
If MyMac = Objmacs.MACAddress Then
set s = WScript.CreateObject("WScript.Shell") '创建WScript.Shell对象
app=s.Run ("e:\Progra~1\ie.vbs") '
end if
为什么我的代码另存为vbs后不会运行啊 mac填写没错的 ie.vbs 也存在的作者: keyroad 时间: 2008-3-18 09:51
StrComputer = "."
MyMac = "00-19-E0-23-08-FF"
set ObjMAC =GetObject("Winmgmts:\\" & StrComputer & "\Root\Cimv2")
Set ObjMacs = ObjMac.get("Win32_NetworkAdapterConfiguration.index=1")
If MyMac = Objmacs.MACAddress Then
set s = WScript.CreateObject("WScript.Shell") '创建WScript.Shell对象
app=s.Run ("e:\Progra~1\ie.vbs") '
end if
这样也不行啊作者: myweb9169 时间: 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作者: keyroad 时间: 2008-3-18 18:50
set s = WScript.CreateObject("WScript.Shell") '创建WScript.Shell对象
Dim myDate
myDate = #4/13/2008#
if myDate > now then
app=s.Run ("e:\Progra~1\ie.vbs") '