VB.net,我的代码无法运行bat文件

时间:2017-10-02 14:58:30

标签: vb.net file batch-file process startup

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文件无效。打开但什么都不做,如果我打开蝙蝠文件手册(用鼠标和双击逻辑!!!)它的工作。请帮忙

1 个答案:

答案 0 :(得分:1)

您的批处理文件可能基于working directory正在运行,并且因为您使用位于其他文件夹中的软件运行批处理文件,批处理文件的working directory不匹配。

将您的软件放入批处理文件夹中,然后重试。