Call application
Dear sir,
Does I call other program/application in my java application?
I'm looking for your reply.
Eric Chan
Eric Chan
Re: Call application
Supposedly you can run other command-line executables using the java.lang.Process class .. but it works better when executed in Unix systems than on DOS/Windows. I personally have only gotten it to execute the "dir" command in DOS using:
Process pr1 = Runtime.getRuntime().exec("command.com /c dir");
everything else I tried to run failed miserably with an java.io.IOException, including batch files, and Windows Notepad.
MikeD
Re: Re: Call application
...by the way ... this is the very same problem I was trying to get an an answer to when I discovered this web site a month and a half ago .... I still haven't gotten anything to work, on a Windows platform, from any suggestions from the newsgroups, various chat rooms, "Ask the Java Pro", and, unfortunately, not even this message board. :-( ... Consequently, that project died.
MikeD
Re: Call application
The problem is, that Java does'n understand character like '\', which DOS/Windows users to locate or change directories. It'll works, if you run your class-files in the same directory with the file you want to execute.Or if you set PATH to the file you want to execute in your autoexec.bat.
CCQ