Run Batch File From Jar

Discussion in 'Java' started by Badshah, May 2, 2006.

  1. Badshah

    Badshah Guest

    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
    Badshah, May 2, 2006
    #1
    1. Advertising

  2. Badshah wrote:
    > 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
    Alexandre Touret, May 2, 2006
    #2
    1. Advertising

  3. Badshah

    Alex Buell Guest

    On Tue, 02 May 2006 09:15:16 +0200 Alexandre Touret
    <> 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.

    --
    http://www.munted.org.uk

    Take a nap, it saves lives.
    Alex Buell, May 2, 2006
    #3
  4. Badshah

    Badshah Guest

    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
    Badshah, May 2, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    564
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,714
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,745
    Roedy Green
    Feb 14, 2006
  4. Sriram
    Replies:
    1
    Views:
    1,036
  5. batch file/jar file

    , Feb 15, 2008, in forum: Java
    Replies:
    2
    Views:
    541
Loading...

Share This Page