找回密码
 加入
搜索
查看: 1963|回复: 1

[网络通信] 寻求把以下检查检查共享的VBS代码更改成AU3的,谢谢

[复制链接]
发表于 2012-2-9 14:28:03 | 显示全部楼层 |阅读模式
本帖最后由 ganyuansi 于 2012-2-9 15:32 编辑

检查共享的代码。内容如下:

if WScript.Arguments.count <1 then
    WScript.echo "monitorshare computername"
    WScript.quit
end if
Set fs = GetObject("WinNT://" & WScript.Arguments(0)& "/LanmanServer")
Do
    For Each share in fs.Resources
        WScript.echo share.User & " " & share.Path
    next
    WScript.Sleep 10
loop

希望哪位朋友给帮忙转换成Au3的代码,万分感谢。!

根据以上代码初步写了一个:

$GetObj=ObjGet("WinNT://LocalHost/LanmanServer")
if @error then
  Msgbox(0,"Test1","Failed to open WinNT://. Error code: " & hex(@error,8))
  exit
endif

For $ObjItem In $GetObj.Resources
        MsgBox(0,"Test2",@ComputerName&@CRLF&$ObjItem.User&@CRLF&$ObjItem.Path)
Next

可是以上代码在本机运行无结果,在别的共享机器上运行会出一部分结果,然后报错!求提示!
 楼主| 发表于 2012-2-11 11:36:25 | 显示全部楼层
,难道就木有人能帮忙一下哦
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-4 05:33 , Processed in 0.089050 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表