Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6

Thread: Batch files

  1. #1
    Join Date
    Oct 2003
    Posts
    8

    Batch files

    My batch file doesn't seem to work within the AMS distribution folder. The batch file runs a java script (jar) file from within the same folder. All works fine when the folder is on the desktop, but from within the distro directory (in AMS), it cannot find the java file. Any ideas?

  2. #2
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi. I believe a .jar file is a java file, not a javascript file.

    Anyhow open your .bat file in a text editor and make sure the link is yourfile.jar with no folder path and then make sure you put the .bat file and .jar file side by side in the distribution folder and the batch file should find the file just fine...

    That being said, be careful, you can't just run a .jar file on any computer. I think they are companion files to applets but further than that machines such as mine do not execute .jar files, there's no application associated with that extension over here... My guess is that will be somewhat common for .jar extension since I haven't really heard of that being used as a deployment extension such as .exe... So in my case the .bat file would fail to do anything even if it finds the ,jar file...

    Corey Milner
    Creative Director, Indigo Rose Software

  3. #3
    Join Date
    Oct 2003
    Posts
    8
    Hi Corey,

    There isn't a path, and they are within the same folder. It can run from any directory on the computer, except from within AMS. I can even run it from start>RUN .

    This is the batch:
    @echo off

    rem double-click this file to launch DocsDiag with parameters

    java -cp docsdiag.jar docsdiag -vv -log -community public
    pause

    BTW, Sun's Java will be installed on computers that can't run it.

    Thx.
    Last edited by shelbygt; 10-29-2003 at 06:29 AM.

  4. #4
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Nope. No Java runs here. If it tries my antivirus squashes it silently...

    Corey Milner
    Creative Director, Indigo Rose Software

  5. #5
    Join Date
    Apr 2001
    Posts
    92
    I don't know if this is the solution, but have you tried setting your Working Directory to the location you are running the batch file from? IE %SrcDir% or %SrcDrv% (add a folder afterwards if file is within a folder ie %SrcDir%\data ).

  6. #6
    Join Date
    Oct 2003
    Posts
    8
    Originally posted by cchian
    I don't know if this is the solution, but have you tried setting your Working Directory to the location you are running the batch file from? IE %SrcDir% or %SrcDrv% (add a folder afterwards if file is within a folder ie %SrcDir%\data ).
    Yes, but still no bat file. I think I would have to point to "java.exe" in the windows directory to get it to work that way, or something.

    I'm just going to forget the batch file and go straight command line. The batch file was only used so that you wouldn't have to go command line.:

    File.execute %SysDir%\cmd.exe

    with the command line:

    /c java -cp "%SrcDir%\docsdiag\docsdiag.jar" docsdiag -vv -log -community public

    This also worked:

    copy.file "docsdiag.jar"
    destination %TempDir%

    file.execute "cmd.exe"

    /c jview /cp docsdiag.jar docsdiag -vv -log -community public

    I don't have to point to the directory with this one. I used a copy.file action to drop the docsdiag file into the %TempDir%, though. I'm wondering if I should go this route instead. Does this mean it's using Microsoft's JVM instead of Sun's?

    As long as I get the same results either way, I don't care.

    Thanks for the help.
    Last edited by shelbygt; 10-30-2003 at 03:35 AM.

Similar Threads

  1. rename multiple files
    By jenny62 in forum Setup Factory 6.0
    Replies: 1
    Last Post: 04-13-2004, 01:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts