Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Java
Expertise: Beginner
Aug 17, 1998



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Process class

Using VCafe 2.8 in a Win95 enviornment, I'm trying to spawn a local executable during the runtime of a Java application. I've tried using:

Process p = Runtime.getRuntime().exec(strCmd);
but the only value of "strCmd" that was successful was strCmd = "c:\command.com /c dir"

I'm really trying to run something like Windows Notepad, or even a *.bat file.

The only reason you found you had to use command.com to invoke a program is because the command you used in your test program is not an actual executable. The dir command is part of the command.com shell and cannot be executed separately. If you change your command string to "C:\WINDOWS\NOTEPAD.EXE", you should have no problem launching the program. But when executing shell commands like dir, you must invoke command.com.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date