yjiawfn 发表于 2008-10-2 01:55:18

连续调用dos命令怎么弄?

#include <Process.au3>
$rc = _RunDos("start Http://www.autoitscript.com")

这里的#include <Process.au3>什么意思呢?

如果
$rc = _RunDos("start Http://www.autoitscript.com")
$rd = _RunDos("start Http://www.autoitscript.com")
也不行!

哎!怎么办

还有如果

Run(@ComSpec & ' if exist name.txt del name.txt',"", @SW_HIDE)
Run(@ComSpec & ' find "Machine name" dxdiag.txt >name.txt',"", @SW_HIDE)
Run(@ComSpec & ' for /f "skip=2 tokens=3" %%M in (name.txt) do set pp=%%M',"", @SW_HIDE)
Run(@ComSpec & ' if exist all.txt del all.txt',"", @SW_HIDE)
Run(@ComSpec & ' find "             Memory:" dxdiag.txt >all.txt',"", @SW_HIDE)
Run(@ComSpec & ' for /f "skip=2 tokens=2,3*" %%I in (all.txt) do set lo=%%I',"", @SW_HIDE)
Run(@ComSpec & ' @echo %pp% %lo% >>\\gameserver\tool$\整理.txt',"", @SW_HIDE)

很郁闷吧!

不知道杂弄类

[ 本帖最后由 yjiawfn 于 2008-10-3 02:59 编辑 ]

liongodmien 发表于 2008-10-2 08:43:59

LZ的那些代码是找来的吧?

#include <Process.au3> ;包含一个特殊脚本,可以在这脚本里使用此脚本的UDF
$rc = _RunDos("start Http://www.autoitscript.com") ;打开一个网址,并返回程序的PID(起码是这个意思,但可惜这样调用,不能获得!与前面的变量名是什么一点关系统也没有!)

$rc = _RunDos("start Http://www.autoitscript.com")
$rd = _RunDos("start Http://www.autoitscript.com")
两个命令的本质一点没变,所以情况一致!

下面的DOS命令都是用隐藏方式运行的,所以在运行后会看不见它的运行情况!
Run(@ComSpec & ' if exist name.txt del name.txt',"", @SW_HIDE)
Run(@ComSpec & ' find "Machine name" dxdiag.txt >name.txt',"", @SW_HIDE)
Run(@ComSpec & ' for /f "skip=2 tokens=3" %%M in (name.txt) do set pp=%%M',"", @SW_HIDE)
Run(@ComSpec & ' if exist all.txt del all.txt',"", @SW_HIDE)
Run(@ComSpec & ' find "             Memory:" dxdiag.txt >all.txt',"", @SW_HIDE)
Run(@ComSpec & ' for /f "skip=2 tokens=2,3*" %%I in (all.txt) do set lo=%%I',"", @SW_HIDE)
Run(@ComSpec & ' @echo %pp% %lo% >>\\gameserver\tool$\整理.txt',"", @SW_HIDE)

sanhen 发表于 2008-10-2 08:50:21

直接运行BAT吧。

renren 发表于 2008-10-2 09:45:33

赞成,你那命令行太多了,无语,直接运行BAT吧,想别人看不到,自己包含文件进去`释放后运行,之后删除.
页: [1]
查看完整版本: 连续调用dos命令怎么弄?