Я пытаюсь запустить этот код, который обычно запускается из командного файла
Код пакетного файла:
@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
"%ProgramFiles%\Java\jre6\bin\java.exe" -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar
PAUSE
Код Vb.net:
If cmbserverapplication.Text = "Bukkit Server" Then
If System.IO.File.Exists(root + "\craftbukkit-0.0.1-SNAPSHOT.jar") = True Then
If Environment.Is64BitOperatingSystem = True Then
bit = "64"
Else
bit = "32"
End If
serverpath = "craftbukkit-0.0.1-SNAPSHOT.jar"
Dim javapath As String
If bit = 64 Then
If System.IO.File.Exists("C:\Program Files (x86)\Java\jre7\bin\java.exe") = True Then
javapath = "path = C:\Program Files (x86)\Java\jre7\bin\java"
Else
javapath = "path = C:\Program Files (x86)\Java\jre6\bin\java"
End If
Else
If System.IO.File.Exists("C:\Program Files\Java\jre7\bin\java.exe") = True Then
javapath = "path = C:\Program Files\Java\jre7\bin\java"
Else
javapath = "path = C:\Program Files\Java\jre6\bin\java"
End If
End If
Dim pi As New ProcessStartInfo("Cmd.exe")
pi.Arguments = "@ECHO OFF"
pi.Arguments = "SET BINDIR=%~dp"
pi.Arguments = "CD /D ""%BINDIR%"""
pi.Arguments = """" + javapath + ".exe" + """" + " -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar"
pi.Arguments = "Pause"
Process.Start(pi)
Me.Close()
Else
MsgBox("The server file does not exist. Please make sure that you have select the right file type and that it has not been renamed.")
End If
End If
End If
Когда я запускаю код, cmd.exe открывается, но тогда ничего не происходит