【发布时间】:2018-03-13 16:19:18
【问题描述】:
Dim app As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
If System.IO.Directory.Exists(app & "\Divers") Then
Try
Process.Start(app & "\Divers\b.bat")
cs.Text = "OK"
cs.Refresh()
Catch ex As Exception
eror.Text = "(B) Problems"
cs.Text = "error"
End Try
Try
Process.Start(app & "\Divers\Realtek\diver.exe")
d.Text = "OK"
Catch ex As Exception
DebugLog()
error.Text = "Driver Problems"
cs.Text = "error"
End Try
Try
Process.Start(app & "\Divers\a.bat")
CVS.Text = "OK"
Catch ex As Exception
error.Text = eror.Text & "(A) Problems"
cs.Text = "error"
End Try
那是我的代码家伙,但 bat 文件不起作用。已打开但什么也不做,如果我打开 bat 文件手册(用鼠标和双击逻辑!!!)它的工作。请帮忙
【问题讨论】:
-
代码在 .Start 部分进行吗?文件是否执行但不正确?也许 WorkingDirectory 现在不是正确的,它可以在不同的文件夹下执行。
-
你应该在你的应用中的某处显示
ex.Message的内容。
标签: vb.net file batch-file process startup