Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

Run Batch File From Jar

Thread view: 
Badshah - 02 May 2006 08:12 GMT
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
Alexandre Touret - 02 May 2006 08:15 GMT
> Hi Friends ,
>
[quoted text clipped - 7 lines]
> 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
Alex Buell - 02 May 2006 09:15 GMT
On Tue, 02 May 2006 09:15:16 +0200 Alexandre Touret
<atouretNOSPAM@free.fr> waved a wand and this message magically
appeared:

> > 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 ?

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

Signature

http://www.munted.org.uk

Take a nap, it saves lives.

Badshah - 02 May 2006 09:50 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.