当我用如下方法获取用户mac地址时候提示
出错代码为
sh.run "%comspec% /c nbtstat -A " & strIP & " > d:\ipmac\" & strIP & ".txt",0,true
其作用是运行windows命令并把执行结果写入文件
出错内容为
Microsoft VBScript 运行时错误 错误 '800a0046'
没有权限
/ipmac.asp,行 35
但是我开启了
wscript.network,fos和wscript.shell,的everyone权限 还是不行
代码
function getClientMac(strIp) dim net,sh,fso,ts,data,macaddress Set net = Server.CreateObject("wscript.network") Set sh = Server.CreateObject("wscript.shell") sh.run "%comspec% /c nbtstat -A " & strIP & " > d:\ipmac\" & strIP & ".txt",0,true Set sh = nothing Set fso = createobject("scripting.filesystemobject") Set ts = fso.opentextfile("d:\ipmac\" & strIP & ".txt") macaddress = null Do While Not ts.AtEndOfStream data = ucase(trim(ts.readline)) If instr(data,"MAC ADDRESS") Then macaddress = trim(split(data,"=")(1)) Exit Do End If loop ts.close Set ts = nothing 'fso.deletefile "d:" & strIP & ".txt" Set fso = nothing getClientMac = macaddress ' getClientMac = "SSSSSSS" end function
出错代码为
sh.run "%comspec% /c nbtstat -A " & strIP & " > d:\ipmac\" & strIP & ".txt",0,true
其作用是运行windows命令并把执行结果写入文件
请问如何解决