Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6136397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:35:53+00:00 2026-05-23T17:35:53+00:00

It am trying to launch this code that would normally run from a batch

  • 0

It am trying to launch this code that would normally run from a batch file

Batch file code:

    @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 Code:

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

When I run the code cmd.exe opens but then nothing happens

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:35:54+00:00Added an answer on May 23, 2026 at 5:35 pm

    Three issues:

    1. Your java path starts with the term “path = “, confusing the command line. Remove this.

    2. A command line can only run one command. By setting pi.Arguments repeatedly, you’re replacing the command each time. The only command executed is PAUSE.

    3. Your command line for CMD is completely out. It should look something like this:

      Cmd.exe /c BatchFile.bat
      

    If you really want to run multiple commands, you can use && between each line.

    Try this. Change the WorkingDirectory as necessary. I purposely left the space off on the SET BINDIR command to prevent an additional space appearing in the path. On other lines, I left it there for readability.

    Dim pi As New ProcessStartInfo("Cmd.exe")
    pi.WorkingDirectory = "C:\Location of Batch file"
    pi.Arguments = "/c " & _
        "@ECHO OFF && " & _
        "SET BINDIR=%CD%&& " & _
        """" & JavaPath & """ -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar && " & _
        "PAUSE"
    Process.Start(pi)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a batch script, this script is responsible to launch a
I'm trying to launch another process from a service (it's a console app that
I'm trying to launch embedded Youtube videos from a UIWebView, but get this error
I have downloaded TableView sample code '4_TableViewCellSubviews' from internet. I am trying to run
When trying to launch and run a flex/java project in eclipse I kept getting
I'm trying to launch my ClickOnce application using C# code with HttpWebRequest class. The
I am trying to launch an existing MS Access database (Access 2010) from a
I'm trying to launch another application from C# application, is there a way to
I am trying to make a simple app from a tutorial that does not
I have an application that can import an XML file through this terminal command

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.