Jul 31, 2009 6:12 AM
Run .bat file with arguments?
-
Like (0)
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.
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
How 'bout setting environment variables?
type test.bat
echo %BLA% > c:\test.txt
$.setenv("BLA","value");
File("c:\\test.bat").execute();
Dirk
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 ![]()
Hi,
Thank you very much. It is helpful answer and it is working...
Regards
Kumar
Copyright © 2011 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).