These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Launch a batch file with a parameter

crifort
Registered: Sep 3 2008
Posts: 4
Answered

Hi
is-it possible to launch, from a PDF file, using JS script, a batch file with a parameter?

exemple of Dos command line: C:\MrnMicro\Commun\CmdCible\ValeurQry.cmd F12-1

batch file code:

del c:\temp\NoCibleReq.txt
echo %1 >c:\temp\NoCibleReq.txt
"msaccess.exe" "C:\MrnMicro\Commun\CmdCible\descriptiondescibles_v2000.mdb" /x Ouverture

My Product Information:
Acrobat Standard 7.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There is a way, But it's tricky. In Acrobat 8 and later the user will get a warning popup.

Use "app.launchURL()", where the URL that's passed in is prefixed with "file://"

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script