Can Adobe Acrobat Launch a Local BAT File with JavaScript?
Question details
The user wants to launch a local BAT file from Acrobat JavaScript using app.launchURL().

- Product
- Adobe Acrobat and Acrobat Reader
- Device & OS
- not provided
- Scenario
- A PDF script attempts to start a local batch file, including through a trusted function.
- Observed behavior
- The script returns undefined, and the BAT file does not launch.
Identify what the BAT file is intended to do and inspect its commands before running it. Only run scripts from a source you trust.
Run the batch file through a separate user-initiated workflow
Use a separate application or manually start the script instead of trying to launch it from PDF JavaScript.
Acrobat and Acrobat Reader do not allow PDF JavaScript to launch executable files such as BAT files. This restriction helps prevent malicious PDFs from running commands that could damage a system. A trusted function does not provide a bypass.
An undefined return value from app.launchURL() does not establish that the batch file ran successfully.
Open the BAT file in a text editor and check its commands and source before deciding whether to run it.
On a system that supports BAT files, use the file manager or an authorized command-line application to run the reviewed script yourself.
Remove the app.launchURL() call intended to launch the BAT file from the PDF script, and provide users with separate instructions for the task.

Work with PDFs and Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Microsoft Office files. Its format compatibility helps make migration straightforward. It does not bypass Acrobat's restriction on launching BAT files.

Frequently Asked Questions
Can a trusted Acrobat JavaScript function launch a BAT file?
No. A trusted function does not override Acrobat's restriction on launching executable files from PDF JavaScript.
Does an undefined result from app.launchURL() mean the script ran?
No. An undefined return value does not confirm that the BAT file ran. Acrobat blocks PDF JavaScript from launching executable files.
Why does Acrobat block a PDF from launching a batch file?
A BAT file can run system commands, including commands that delete or change files. Blocking execution helps protect users from malicious PDFs.
How can I run the BAT file instead?
First inspect the file in a text editor and verify its source. On a system that supports BAT files, start it separately using the file manager or an authorized command-line application.




