MByD
MByD

Reputation: 137272

Open up command line from Java application

Is it possible to open a command line from Java application, meaning, I have a GUI (written in Java) and I want a command line window to open up (at a specific location) in some cases. is it possible to implement?

Thanks, Binyamin

Upvotes: 1

Views: 5029

Answers (1)

dacwe
dacwe

Reputation: 43504

This works (revised solution):

String path = "c:\\";
Runtime.getRuntime().exec(new String[] { "cmd.exe", "/C", "\"start; cd "+path+"\"" });

Upvotes: 3

Related Questions