Skip navigation
kumar1981
Currently Being Moderated

Run .bat file with arguments?

Jul 31, 2009 6:12 AM

Hi,

 

   I need to run the .bat file with parameters/arguments in Adode Indesign JavaScript. "File.execute()" executes the file using the appropriate application.It executes the .bat file suceessfully.But I am unable to pass the arguments.I need to execute the command like

Eg : test.bat parameter1 parameter2

 

var myFile=new File("c:\\test.bat");

myFile.execute();

 

The above statements works fine. Is it possible to execute the with parameters. Please suggest the solution to above problem.

  • Currently Being Moderated
    Community Member
    Jul 31, 2009 8:41 AM

    How 'bout creating a temporary shell script which executes the batch 

    with the parameters? You then just execute the shell script which 

    executes the batch in turn...

     

    Harbs

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Jul 31, 2009 9:30 AM

    How 'bout setting environment variables?

     

    type test.bat

    echo %BLA% > c:\test.txt

     

    $.setenv("BLA","value");

     

    File("c:\\test.bat").execute();

     

     

    Dirk

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Jul 31, 2009 1:12 PM

    How 'bout always writing out the batch file in full, with the parameters already in place? Then you'd only have to execute it.

     

    The consensus here seems to be Adobe didn't count on anyone trying to run an MS-DOS style batch file from within InDesign

    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points