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 dir"

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

The only reason you found you had to to invoke a program is because thecommand you used in your test program is not anactual executable. The dir command is part of the shell and cannot be executed separately. If you change your command string to “C:WINDOWSNOTEPAD.EXE”, you should have no problem launching the program. But when executing shell commands like dir, you must invoke

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: