Run Batch File From Jar

B

Badshah

Hi Friends ,

I Am A Java Programmer. I Am Developing A Program Which Will Call A
Batch File And I Have Added That Batch File In Jar. But It Is Not
Working. It Is Working Very Well Outside Jar File.
Is Batch File Not Callable From Within Jar File ? If Yes What Else Can
I do ?
Suggestion Required

ThankYou ,
Sohil Surti
 
A

Alexandre Touret

Badshah said:
Hi Friends ,

I Am A Java Programmer. I Am Developing A Program Which Will Call A
Batch File And I Have Added That Batch File In Jar. But It Is Not
Working. It Is Working Very Well Outside Jar File.
Is Batch File Not Callable From Within Jar File ? If Yes What Else Can
I do ?
Suggestion Required

ThankYou ,
Sohil Surti
Hello,
could you put your code (especially the call) on reply?
I think, the problem is due to the call of the resource which is inside
of the JAR...

Regards,
Alexandre
 
A

Alex Buell

You Don't Need To Capitalise Every First Letter In Each Word, Just The
First Letter In A Sentence Will Be Enough, Thank You.
 
B

Badshah

Process p =
Runtime.getRuntime().exec(System.getProperty("user.dir")+"\\MySqlDBA\\Restore.bat
"+ Tdatabase.getText() + " " + Tuser.getText() + " " +
Tpassword.getText() + " " + Tpath.getText().trim());
p.waitFor();

This Is The Code I Am Using To Make Call To Batch File.

This Is Content Of Restore Batch File.

cd c:\program files\mysql\mysql server 5.0\bin
mysql %1 --user=%2 --password=%3 < %4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top