How to Fix Unsafe Location Warnings for CMD Links in Microsoft Office
Question details
Users are seeking a way to stop Microsoft Office from displaying security warnings when clicking hyperlinks that launch CMD files, as adding the folder to Trusted Locations does not resolve the issue.
- Product
- Microsoft Office
- Device & OS
- not provided
- Scenario
- Clicking a hyperlink within an Office document that is linked to a local .cmd executable file.
- Observed behavior
- Office triggers one or more "Unsafe Location" security warnings before opening the CMD file, even if the file and document are stored in a designated Office Trusted Location.
Ensure that any CMD files you intend to execute are from a verified and fully trusted source, as command scripts can pose severe security risks to your system if they contain malicious code.
Submit Feedback on Trusted Location Limitations
Since Office Trusted Locations are primarily designed for VBA and internal Office content, bypassing warnings for external command files is restricted by default. The official recommendation is to submit feedback to Microsoft.
Microsoft intentionally restricts executable files (like .cmd or .bat) from bypassing security warnings, regardless of trusted location settings. Because changing this core security behavior requires a Microsoft update, submitting targeted feedback is the official route to address redundant warnings.
Launch Microsoft Word (or the affected Office application) and navigate to the 'Help' tab on the top ribbon.
Click the 'Feedback' button. Alternatively, you can visit the Microsoft Feedback portal online.
Provide a clear description of the issue, specifically mentioning if you are receiving two separate warnings for a single CMD link, and request better integration with Trusted Locations.
Use VBA Macros Instead of Direct Hyperlinks
If you need a seamless way to run CMD files without hyperlink warnings, you can use a VBA macro. Trusted Locations properly apply to VBA content, allowing the script to run without prompts.
Try WPS Office for a Seamless and Secure Document Experience
If you are frustrated by inflexible security warnings and overly complex Trusted Location settings in Microsoft Office, consider switching to WPS Office. It provides a lightweight, highly compatible alternative with straightforward, user-friendly security controls.
- 1. Download and Install: Visit the official WPS website and download the free WPS Office suite for your operating system.
- 2. Open Your Office Documents: Launch WPS Office and open your existing Word, Excel, or PowerPoint files directly without losing formatting.
- 3. Manage Security Settings: Access the intuitive settings menu to easily configure your trusted files and security preferences.

Frequently Asked Questions
Why do trusted locations not suppress warnings for CMD files?
Office Trusted Locations are primarily designed to trust macros (VBA) and internal Office content. They do not automatically bypass Windows security protocols for external executable scripts like .cmd or .bat due to the high risk of malicious code execution.
Why do I get two separate security warnings when clicking a CMD link?
This often occurs because both Microsoft Office's internal security center and the Windows operating system independently flag the executable file as a potential security risk, resulting in redundant prompts.
Is it safe to disable hyperlink security warnings in Office?
Disabling these warnings globally (such as via Windows Registry edits) lowers your overall system security and can expose your computer to malware. It is only recommended in strictly controlled IT environments where all files are verified.
Can I bypass the CMD warning by using a different file type?
Converting the CMD commands into an authorized VBA macro within the Office document is typically the safest and most reliable way to execute commands without triggering external hyperlink warnings, provided the document is stored in a Trusted Location.




