shell "dir >c:\test.txt" '这里要等它运行完,代码吗,就不多说了,到CSDN上找到很多的. '运行完之后,才写以下语句 open "c:\test.txt" for input as #1 while not eof(1) line input #1,strLine text1.text=text1.text & strline & vbcrlf wend close #1
使用DOS的输出转向将输出内容输出到文件。 Open "C:\temp\huibozhang.bat" For Output As 1 Print #1, "dir c:\*.* > c:\temp\huibozhang.txt" Close 1 Shell "c:\temp\huibozhang.bat"
'这里要等它运行完,代码吗,就不多说了,到CSDN上找到很多的.
'运行完之后,才写以下语句
open "c:\test.txt" for input as #1
while not eof(1)
line input #1,strLine
text1.text=text1.text & strline & vbcrlf
wend
close #1
Print #1, "dir c:\*.* > c:\temp\huibozhang.txt"
Close 1
Shell "c:\temp\huibozhang.bat"
执行完毕,读huibozhang.txt得到所有运行结果。