Computing.Net > Forums > Programming > Calling cmd from java

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Calling cmd from java

Reply to Message Icon

Name: David J. Torres
Date: January 23, 2009 at 15:00:47 Pacific
OS: Windows 2000
CPU/Ram:
Product: /
Subcategory: Java
Comment:

I have spent many hours reading trying to find a solution to my problem.

My problem:
I am calling a runcommand java function from oracle to run a bat file. This bat file has lines like this:
@echo off
d: >nul
cd \oradmin\DEV1\ >nul
"d:\Cypress\bin\fvssn.exe"<"BRUNSK_19100180_101_4_346050.rsp" >nul
exit

For now there is only one line calling that fvssn.exe, but there will be many others to process, I am just testing this with one for now. This bat file will be running on a server. When the web app runs this java function, it runs the bat file which in turn runs the fvssn.exe. I can see the both processes, the cmd.exe and the fvssn.exe, running on the server, but it doesn't create the necessary outputs intended.

This is the contents of the rsp file:
d:\oradmin\DEV1\BRUNSK_19100180_101_4_346050.key
nul
d:\oradmin\DEV1\BRUNSK_19100180_101_4_346050.out
d:\oradmin\DEV1\BRUNSK_19100180_101_4_346050.tls
nul
nul

These are essential inputs for the fvssn.exe. I guess there is nothing to worry about here because this runs fines when the bat file is run from the server.

So, to resume my problem: My bat file runs when it’s double-clicked on the server and creates the two files out and tls. When I running from the java function using the Runtime.getRuntime().exec ( cmd ), it creates the process but not output. It seems like it deadlock or something. I have follow ideas like http://www.javaworld.com/javaworld/... , but no success.

Thanks

David



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Coding Problem DarkBASIC Icon Help



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Calling cmd from java

batch called from Java www.computing.net/answers/programming/batch-called-from-java/17531.html

how do use call function in java like C www.computing.net/answers/programming/how-do-use-call-function-in-java-like-c/951.html

Invoke python function from java www.computing.net/answers/programming/invoke-python-function-from-java/17911.html