MT5×EA UAC (User Account Control) Permission Error: Causes and Solutions for Beginners


What Is a UAC Permission Error?

When running an EA (Expert Advisor) on MT5 (MetaTrader 5), Windows UAC (User Account Control) may cause errors such as “Access Denied” or “Cannot create file”.
UAC is a Windows security feature that restricts write access or configuration changes to protected system areas.

If MT5 is installed in protected folders such as C:\Program Files or C:\Program Files (x86), errors often occur when EAs try to save logs, write settings, or export reports.

You can check where MT5 is installed by right-clicking the MT5 desktop shortcut → selecting “Open file location.”

Right-click MT5 shortcut → Shortcut tab → Open file location


Typical Symptoms (Example Error Messages)

  • cannot open file ... (access denied)
  • failed to save file
  • cannot create directory
  • “Access to the file was denied.”

These occur when the EA or MT5 lacks write permissions.
They are common when saving backtest results, exporting custom indicators, or writing logs.


Why UAC Affects MT5

To protect the system, Windows blocks write access for standard users to certain folders such as Program Files.
If MT5 is installed in these protected areas, UAC may deny EA-generated files (like MQL5\Files and logs), resulting in various errors.

In some environments, files are redirected to the “VirtualStore” (%LocalAppData%\VirtualStore), causing confusion because the files appear missing or settings don’t apply.


Solutions (Step-by-Step for Beginners)

1. Run MT5 as Administrator

This is the simplest solution.
Right-click the MT5 shortcut and choose “Run as administrator.”
This grants MT5 and your EAs the necessary permissions to operate correctly.

Right-click MT5 shortcut → Run as administrator

To always start MT5 as administrator:

  1. Right-click the MT5 shortcut → “Properties”
  2. Go to the “Compatibility” tab → check “Run this program as an administrator”
  3. Click “OK” to save

Right-click MT5 shortcut → Properties → Compatibility tab → Check Run this program as administrator

2. Reinstall to a Non-Protected Folder

If you don’t want to run as administrator every time, reinstall MT5 in a folder that isn’t affected by UAC, such as C:\MT5\ or D:\Trading\MetaTrader5\.
This ensures smooth access for logs, settings, and reports.

MT5 folder placed directly under C drive
Tip: Before reinstalling, copy your existing “Data Folder” (File > Open Data Folder) contents (like MQL5) to the new environment for a smooth transition.

3. Adjust UAC Level (For Advanced Users)

You can lower UAC notifications from the Control Panel.
However, this reduces security—only consider it on a dedicated EA VPS or trading PC.

  1. Search “UAC” in Windows → select “Change User Account Control settings”
  2. Move the slider down to reduce notification frequency → restart your PC

4. Notes for VPS Users

UAC is also enabled on VPS systems.
Default settings can block logs or report saving.
It’s best to set MT5 to always run as administrator and, if necessary, lower UAC notifications to prevent issues.


Pre-Installation & Troubleshooting Checklist

  • Is MT5 running as administrator? (Check shortcut compatibility settings)
  • Is MT5 installed in a non-protected folder? (Avoid Program Files)
  • Are your configuration and logs saved in the expected location? (Check VirtualStore if necessary)
  • Is your VPS configured with the same policy?

Summary

UAC permission errors can be solved by correcting installation location and launch privileges.
The fastest and most reliable solution for beginners is to first “Run as administrator,” then reinstall MT5 to a non-protected path if needed.

Related Articles:
Complete Guide: Installing and Launching MT5 for the First Time (with Screenshots)
How to Install and Run Multiple MT5 Instances on a Single PC/VPS


FAQ

Q. Do I need to run MT5 as administrator every time?
A. No. Once you enable “Run this program as administrator” in the shortcut’s Compatibility settings, it will always launch with admin rights.
Q. Can I still install MT5 under Program Files?
A. You can, but it’s prone to UAC restrictions. Installing in a non-protected folder is safer.
Q. Is lowering the UAC level safe?
A. It increases security risks, so only do this on a dedicated VPS or trading PC.
Q. I can’t find where my files are saved.
A. They may be redirected to the VirtualStore (%LocalAppData%\VirtualStore). Check your actual output path.
Q. Do I need the same settings on a VPS?
A. Yes. UAC also applies to VPS environments, so use admin privileges or install MT5 in a non-protected folder.

Leave a Reply