Can a PDF JavaScript Dialog Open a UNC Network Folder Link?
Question details
The user wants to know if it is possible to include a clickable UNC or mapped network folder path inside a PDF JavaScript dialog that directly opens Windows Explorer.

- Product
- Device & OS
- Windows
- Scenario
- Attempting to create a clickable network folder link within a PDF JavaScript dialog for users to seamlessly access shared network locations.
- Observed behavior
- Standard PDF security restrictions block scripts and dialog text from dynamically launching local or network file paths to protect users from potential security threats.
Keep in mind that modern PDF readers enforce strict security policies to prevent malicious scripts from accessing local or network directories. Standardizing how you share internal paths as text can save users from encountering errors.
Provide the UNC Path as Plain Text
Since JavaScript cannot securely execute folder links in a PDF dialog, providing the network path as plain text allows users to copy and navigate to the location manually.
PDF security restrictions intentionally prevent JavaScript dialogs from launching local or network locations (such as UNC paths or mapped drives) to protect environments from unauthorized scripting attacks.
Design your PDF JavaScript dialog script to output the UNC network path (e.g., \\server\shared\folder) strictly as plain text.
Include a brief instruction within the dialog prompt advising the user to highlight and copy the displayed folder path.
Instruct the user to manually open Windows Explorer, paste the copied UNC path into the top address bar, and press Enter to access the network folder safely.

Hardcode the Link Directly in the PDF File
Instead of relying on a JavaScript dialog, embed a standard hyperlink directly in the PDF document body to point to the desired network location.
Edit and Secure Your PDF Documents Easily
WPS Office provides robust PDF editing capabilities, allowing you to safely insert standard hyperlinks, manage document security, and modify content without relying on complex scripting.
- 1. Open your PDF: Launch WPS Office and open the PDF document you need to modify.
- 2. Edit Links: Navigate to the 'Edit' tab and click on 'Link' to manually insert functional document links pointing to web or file URIs.
- 3. Save and Distribute: Configure document permissions if required, and save your PDF file for secure distribution across your network.

Frequently Asked Questions
Why do PDF readers block UNC paths inside JavaScript dialogs?
PDF readers enforce strict application sandboxing and security restrictions to prevent malicious scripts from gaining unauthorized access to the user's local file system or local area network. Scripts attempting to launch local processes are therefore blocked.
Can I use the file:// protocol in a PDF to open a network drive?
Yes, you can use the file:// protocol (e.g., file://///server/folder) for hardcoded hyperlinks within the body of the PDF document. However, users will typically encounter a built-in security warning prompt asking for confirmation before the link is allowed to open.
Is there any way to bypass PDF security warnings for local links?
Generally, no. For safety reasons, these security warnings cannot be bypassed via the document itself. The behavior is controlled entirely by the end-user's application settings or enterprise network policies, such as the Trust Manager settings.




