积极答复者
Vb2008运行批处理控制问题

问题
答案
-
你好
或者你可以嘗試以下的Code 我試過是可以隐藏批处理运行的时候出现的dos窗体 的 [可以使用 StartInfo.WindowStyle = ProcessWindowStyle.Hidden ]
Dim myProcess As New Process
myProcess.StartInfo.FileName = "F:\Learning\test.bat" '這個batch file 的內容是
'ping -n 10 sharechiwai.wordpress.com
'ping這個網址10次
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
myProcess.Start()
myProcess.WaitForExit() '等待他完成才繼續下面的Code
MsgBox("yeah")Please correct me if my concept is wrong
Chi- 已标记为答案 feiyun0112Moderator 2010年9月3日 1:45
全部回复
-
你好
或者你可以嘗試以下的Code [使用 Process.WaitForExit()]
Dim myProcess As New Process
myProcess.StartInfo.FileName = "D:\FileSystem\batch.bat" '這個batch file 的內容是
'ping -n 10 sharechiwai.wordpress.com
'ping這個網址10次
myProcess.Start()
myProcess.WaitForExit() '等待他完成才繼續下面的Code
MsgBox("yeah")
Please correct me if my concept is wrong
Chi -
你好
或者你可以嘗試以下的Code 我試過是可以隐藏批处理运行的时候出现的dos窗体 的 [可以使用 StartInfo.WindowStyle = ProcessWindowStyle.Hidden ]
Dim myProcess As New Process
myProcess.StartInfo.FileName = "F:\Learning\test.bat" '這個batch file 的內容是
'ping -n 10 sharechiwai.wordpress.com
'ping這個網址10次
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
myProcess.Start()
myProcess.WaitForExit() '等待他完成才繼續下面的Code
MsgBox("yeah")Please correct me if my concept is wrong
Chi- 已标记为答案 feiyun0112Moderator 2010年9月3日 1:45