happytc 发表于 2011-2-2 01:19:06

可以在au3里可以创建一个COM对象来得到dos下命令返回值

本帖最后由 happytc 于 2011-2-2 01:31 编辑

To:wu5cheng3,你可以用象下面的,不过,你写的标题跟内容都需要猜才明白意思了

$WshShell = ObjCreate("WScript.Shell")
$Exec = $WshShell.Exec ("ipconfig /all")
$Reture = $Exec.StdOut.ReadAll
MsgBox(0,0,$Reture)

gzh888666 发表于 2011-2-2 02:57:06

写到文本里吧,msgBOX不够长!{:face (303):}

netegg 发表于 2011-2-2 04:08:13

有毛病,stdin应该就行了

happytc 发表于 2011-2-2 04:17:37

有毛病,stdin应该就行了
netegg 发表于 2011-2-2 04:08 http://www.autoitx.com/images/common/back.gif

“有毛病“------ 指啥意思? 不会是骂我吧,应该不是

netegg 发表于 2011-2-2 04:32:51

本帖最后由 netegg 于 2011-2-2 04:44 编辑

回复 4# happytc
记错了,不过建那个wsh对象有什么用

#include <Constants.au3>

Local $foo = Run(@ComSpec & " /c ipconfig /all", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $line
While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDOUT read:", $line)
Wend

happytc 发表于 2011-2-2 04:55:08

回复 5# netegg

呵,另一种方式达到同样目的
页: [1]
查看完整版本: 可以在au3里可以创建一个COM对象来得到dos下命令返回值