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

    Default question with command prompt and Runtime.exec()

    Hi everyone!

    I am using:

    Runtime.getRuntime().exec(connect).

    To start a MS-DOS application that connects to a server (connect, connects to a server). After doing that, I send info to the server.
    The problem is that if:

    connect = "whatever to connect";

    it gets stuck. However if:

    connect = "cmd /c start whatever to connect";

    it works. But the command prompt appears and you see what is happening while the computer is getting connected to the server. Do you know why? I would like to connect to the server but without having to show the command prompt.

    Thanks in advance

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Simply you want to start the process, but the console is hidden is it? Is that console application also coded in Java?

  3. #3
    mosquetero is offline Member
    Join Date
    Aug 2009
    Posts
    2
    Rep Power
    0

    Default

    Yes, I want to start the process but to hide the console. I don't think that the console application is coded in java, at least I haven't coded it

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Actually you cannot start a process hidden in Java. Console hiding can be done with the console application. Or else it may possible to start the process as a service.

Similar Threads

  1. runtime.exec
    By cotede2 in forum Advanced Java
    Replies: 3
    Last Post: 04-17-2009, 05:18 PM
  2. Replies: 6
    Last Post: 12-29-2008, 02:47 PM
  3. help with Runtime.exec()
    By Lanfear in forum New To Java
    Replies: 18
    Last Post: 12-16-2008, 11:09 AM
  4. Tomcat and Runtime.exec
    By karine in forum Introductions
    Replies: 1
    Last Post: 10-03-2008, 08:25 AM
  5. Runtime.exec()
    By hknyo in forum Advanced Java
    Replies: 2
    Last Post: 08-16-2008, 12:40 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
  •