找回密码
 加入
搜索
查看: 1758|回复: 9

是否可以让命令行在窗口中运行

[复制链接]
发表于 2009-8-10 22:57:16 | 显示全部楼层 |阅读模式
不知道能不能让CMD命令执行在自己定义的窗口中显示执行?
发表于 2009-8-11 01:07:38 | 显示全部楼层
曾经见过,似乎可以模拟一下
 楼主| 发表于 2009-8-11 03:46:18 | 显示全部楼层
也就是潜入到自己用AUTOIT创建的窗体中,不知道要怎么写?能提供下代码吗?
发表于 2009-8-11 13:23:30 | 显示全部楼层
这个我也很感兴趣,同等高手
 楼主| 发表于 2009-8-11 15:12:06 | 显示全部楼层
等待中......怎么高手们都藏起来了。
发表于 2009-8-11 17:20:28 | 显示全部楼层
本帖最后由 l4ever 于 2009-8-11 17:30 编辑

#include <GUIConstantsEx.au3>
$Form1 = GUICreate("我的CMD", 700, 430)
$i1 = GUICtrlCreateInput("", 5, 5, 300, 20)
$b1 = GUICtrlCreateButton("Run", 315, 5, 50, 20)
$cmd = GUICtrlCreateEdit("cmd result is here" & @CRLF, 0, 30, 700, 400)
GUISetState(@SW_SHOW)


While 1
        $msg = GUIGetMsg()
        Select
                        Case $msg = $GUI_EVENT_CLOSE
                        Exit
                Case $msg = $b1
                        $command = GUICtrlRead($i1)
                        cmdping($command)
                       
EndSelect
WEnd
Func cmdPing($var)
        $vara = $var&">"&@TempDir&"\"&"Temp.txt"
        RunWait(@ComSpec & ' /c "'&$vara&'"',"", @SW_HIDE)
        $text = FileRead(@tempdir&"\Temp.txt")
        GUICtrlSetData ($cmd,$text)
        FileDelete(@tempdir&"\Temp.txt")
EndFunc
 楼主| 发表于 2009-8-11 18:02:23 | 显示全部楼层
#include
$Form1 = GUICreate("我的CMD", 700, 430)
$i1 = GUICtrlCreateInput("", 5, 5, 300, 20)
$b1 = GUICtrlCreateButton("Run", 315, 5, 50, 20)
$cmd = GUICtrlCreateEdit("cmd result is here" & @CRLF ...
l4ever 发表于 2009-8-11 17:20

谢谢了!
这似乎是模拟的。不知道能不能真正内嵌。
我的目的是实时查看命令行程序打包的进度,但不希望在通常命令行中看到。如果使用上面的方法,仅仅是打包后的结果,这并不是我需要的。
发表于 2009-9-3 20:22:51 | 显示全部楼层
请查看此贴,希望能帮助你或给你启发
http://www.autoitx.com/forum.php?mod=viewthread&tid=4185
发表于 2009-9-6 11:47:13 | 显示全部楼层
很多实例可以搜索到哦
发表于 2009-9-8 09:38:39 | 显示全部楼层
学习中。。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-2 19:50 , Processed in 0.083292 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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