0

I have a JavaFX Project. I open the CMD on a button click, but the CMD shows file path. Is it possible to not show file path and simply provide an update message similar to the one below?

Image of CMD with no current location

How would i do so? The following is how i open the CMD window.

try{
            Runtime.getRuntime().exec("cmd.exe /c start cls cd\\");
            System.out.println("ok");
        }
        catch(Exception e){
            e.printStackTrace();
        }

Thank you for your help

hfrog713
  • 400
  • 1
  • 5
  • 18
  • See [this question](http://stackoverflow.com/questions/4497579/making-a-jar-file-for-console) – Itai Apr 28 '16 at 13:48
  • I don't think that really answers my question. I am looking for a way to open a blank(empty) cmd window and be able to write to it. – hfrog713 Apr 28 '16 at 13:52
  • That's not really possible, as far as I'm aware. What you are currently doing is creating a new process (cmd.exe), which is bad because A. The user can do anything in it - it's just a new commandline instance; and B. It will only work on Windows machines. If using the OS console (the one that started your program) is not an option, the next best thing is probably to open a new `Stage` with a `TextArea` or something similar. – Itai Apr 28 '16 at 13:56

0 Answers0