找回密码
 加入
搜索
查看: 1967|回复: 5

用RUN执行批处理之后如何得到返回的内容?

[复制链接]
发表于 2009-3-26 18:20:04 | 显示全部楼层 |阅读模式
执行批处理之后如何得到返回的内容
非常感谢各位的解答.谢谢

[ 本帖最后由 l4ever 于 2009-3-28 12:14 编辑 ]
发表于 2009-3-26 21:44:21 | 显示全部楼层
搜索论坛
dos 回显
发表于 2009-3-26 22:07:26 | 显示全部楼层
;注意:回显截取只支持Run而不是RunWait
#include <Constants.au3>
Opt("MustDeclareVars",1)
_test()
Func _test()
Local $foo,$line,$lines
$foo = Run(@ComSpec & " /c sc query Alerter", @SystemDir, @SW_HIDE, $STDOUT_CHILD)
$lines = ""
While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
     $lines &= $line
Wend
MsgBox(0,"test",$lines)
EndFunc
发表于 2009-3-26 22:25:56 | 显示全部楼层
juyz 朋友正解。

如果常用,可以参考:
http://www.autoitx.com/forum.php?mod=viewthread&tid=5962
发表于 2014-5-22 11:13:57 | 显示全部楼层
谢谢分享,收藏一下
发表于 2018-9-20 23:35:17 | 显示全部楼层
谢谢分享,收藏一下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-26 23:11 , Processed in 0.072185 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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