PDF Security & Access Issues

Can Adobe Acrobat Launch a Local BAT File with JavaScript?

Muhammad TalhaMuhammad Talha Nov 19, 2026 868 views

Question details

The user wants to launch a local BAT file from Acrobat JavaScript using app.launchURL().

Can Adobe Acrobat Launch a Local BAT File with JavaScript?
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.
Before you start

Identify what the BAT file is intended to do and inspect its commands before running it. Only run scripts from a source you trust.

Solution 1Recommended

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.

1
Review the script

Open the BAT file in a text editor and check its commands and source before deciding whether to run it.

2
Start it outside the PDF

On a system that supports BAT files, use the file manager or an authorized command-line application to run the reviewed script yourself.

3
Keep the PDF workflow separate

Remove the app.launchURL() call intended to launch the BAT file from the PDF script, and provide users with separate instructions for the task.

Run the batch file through a separate user-initiated workflow
Security restriction: Do not disable security protections to try to make a PDF execute a local script.
Free Microsoft Office alternative

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.

Open and work with PDF documents alongside your other filesCompatible with Microsoft Office formats such as DOCX, XLSX, and PPTXUse a familiar interface for everyday document tasksMove existing Office files into a lightweight workspace
microsoft office alternative - wps office

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.