What is the difference between getRuntime().exec("my command") and executing "my command" from a regular command prompt?
I'm trying to open ms access with a specific file, which I can do a few different ways from a command prompt, but I keep getting a warning when I try to do this from java that Access can't open it. Any suggestions?
exact warning - Ms Access is unable to open the data access page. The file you attempted to load was not recognized as HTML....
It can find the file. If I use an incorrect name it gives me a different warning.
Runtime.exec(String) is very picky about the command line parameters, in particular if they contain characters that need to be escaped. I find it much less troublesome to use the Runtime.exec(String) variant.
By the way: Access can open HTML files? You learn something new every day...
posted 13 years ago
i guess it can. I just tried cause I was wondering. It tries to connect to setup some connection to a DB, but it will open the html file.
Also go to a command window and try CMD /? and COMMAND /?. There are some things that require these commands when you go through runtime exec.
Other gotchas ... some commands hang up if you're not reading stdout and stderr. Look into the getWhatever methods on the object you get from exec.
You can open files with the RUNDLL32 command. Google for that one for details. It's just like clicking a file in Explorer or entering a filename like a command. Try "myspreadsheet.xls" as a command for fun. For a file that exists, of course.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
how do I do my own kindle-like thing - without amazon