Web Analytics Made Easy -
StatCounter How do I launch a program with a batch file and have the command line close...? - CodingForum

Announcement

Collapse
No announcement yet.

How do I launch a program with a batch file and have the command line close...?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resolved How do I launch a program with a batch file and have the command line close...?

    How do I launch a program with a batch file and have the command line close without closing the program?

    The story:
    I'm trying to pass the location of a file to my java program by double clicking the file.

    To do this, I created this batch file:
    Code:
    cd C:\Location\of\Class\File
    java myClass %1
    When I double on the correct file, the batch file is launched, it changes directories, and starts the program while passing the file location.

    My problem is, the command line window will stay open until my program closes. If you attempt to close the command line window before the program closes, it crashes my program.

    I don't want my program to be attached to command line.

    What can I do to fix this problem?

    Thanks for all of you help!
    Last edited by bobleny; Apr 3, 2009, 12:46 AM.
    --www.firemelt.net--
    * No good deed goes unpunished.
    * Cheer up, the worst has yet to come...

  • #2
    Look into the start command, it might do what you want.

    For more information do start /? at the command prompt.
    OracleGuy

    Comment


    • #3
      Hmm... I did not know that start had little sub commands....

      This worked:
      Code:
      @echo off
      cd C:\Location\of\Class\File
      start/MIN java myClass %1
      It is technically still there but it can't bee seen by the average user, which is enough for me.

      Thank you very much!
      --www.firemelt.net--
      * No good deed goes unpunished.
      * Cheer up, the worst has yet to come...

      Comment

      Working...
      X