The error message "This program is blocked by group policy" typically indicates that your system's group policy settings are restricting certain actions or applications. This is common in environments managed by IT departments, such as corporate or educational institutions. Here are some troubleshooting steps you can take to resolve this issue:
1. Run MATLAB as Administrator
Running MATLAB as an administrator can sometimes bypass group policy restrictions if the issue is related to permissions.
2. Contact Your System Administrator
The next step is to contact your system administrator or IT support team. They have the necessary permissions to modify group policies and can provide a solution tailored to your organization's policies.
3. Check Group Policy Settings
If you have administrative rights on your computer, you can check and modify group policy settings:
- Press the Windows + R keys to open the Run dialog. Then you should type gpedit and click OK to open the Group Policy window.
- Expand User Configuration > Administrative Templates > System. In the right pane, navigate to Don’t run specified Windows applications and double-click it.
- Then click the Show button. Ensure that MATLAB and related binaries (e.g., compilers), as well as specific folders (such as the Windows Temp, and MATLAB/Simulink codegen and cache folders), are not blocked.
- Remove the target program or application from the disallowed list and click OK.
4. Check Antivirus and Firewalls
Sometimes antivirus software can interfere with execution. Ensure that MATLAB and related binaries (e.g. compilers) are allowed in your antivirus software. Also check if Windows Defender or any other security software is blocking the execution of MATLAB-related processes.
Note, that e.g. the MinGW compilers are usually installed in the C:\ProgramData directory, not the MATLAB installation folder itself.
5. Modify Temp Folder Permissions and Location
If the error message points to a file located in the temp folder, check that your account has "Full Control" on the "C:\Users\xxxx\AppData\Local\Temp" folder.
If this doesn't help, change the Temp folder location to a safe directory. Run these commands in MATLAB:
setenv('TMP', <path to a safe location>)
clear tempdir
Note that "setenv" changes the Temp directory for the current MATLAB session only and does not affect other applications or system-wide environment variables. After changing the Temp directory, rerun your workflow to confirm the workaround. To automate the execution of the above commands, place them in a startup.m script and add it to your MATLAB path, such as the MATLAB userpath. 5. Reinstall MATLAB/Simulink
In some scenarios, especially if the administrator privileges on your Windows account have changed, reinstalling MATLAB/Simulink can help. If MATLAB was initially installed when you had administrator privileges, it might continue to assume it has certain permissions even after those privileges have been revoked. A reinstallation can potentially resolve this issue by updating the permissions.