首页 新闻 会员 周边 捐助

asp 获取用户mac地址提示无权限

0
悬赏园豆:30 [待解决问题]

当我用如下方法获取用户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权限 还是不行

代码

VBScript code
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命令并把执行结果写入文件

请问如何解决

Kevin.Cheung的主页 Kevin.Cheung | 初学一级 | 园豆:70
提问于:2011-05-05 12:58
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册