Results 1 to 2 of 2
  1. #1
    xclaim is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default running command prompt using java

    hi guys,
    i am still quite new to programming. may i know how to run a bat file or command in the background of the application
    without showing the command prompt.

    right now i am able to do it, however it will still pop up the command prompt

    the following is my coding.
    try {
    String command = "cmd /C start C:/project/mkiosk/lib/createMovieJar.bat ";
    Runtime rt = Runtime.getRuntime();

    pr = rt.exec(command);

    } catch (IOException e) {
    e.printStackTrace();
    }

  2. #2
    xclaim is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default

    never mind i have solve the problem which is change the command to this
    String command = "C:/project/mkiosk/lib/createMovieJar.bat ";
    Runtime rt = Runtime.getRuntime();

    pr = rt.exec(command);

Similar Threads

  1. Command Prompt Java
    By kelvinsmj in forum New To Java
    Replies: 8
    Last Post: 11-27-2009, 10:30 AM
  2. Replies: 6
    Last Post: 04-20-2009, 04:34 AM
  3. Running applet from command prompt
    By niteshwar.bhardwaj in forum Java 2D
    Replies: 1
    Last Post: 03-12-2009, 08:10 AM
  4. problems in running d command prompt commands
    By postaholic066 in forum Advanced Java
    Replies: 1
    Last Post: 09-10-2008, 03:47 PM
  5. Running eclipse java project on command prompt
    By hnmapara in forum New To Java
    Replies: 1
    Last Post: 07-09-2008, 08:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •