MATLAB Answers


Problem with Rapid Accelerator and Windows Firewall

Asked by Mike
on 15 Feb 2013

I have a script which requires programmatically changing the Simulation Cache and Code Generation folders before rebuilding the rapid accelerator target(always the same simulation model). This process happens multiple times within my script after which Windows Firewall pops up with a message that “Windows Firewall has blocked some features of this program”. Each time the executable referenced in the firewall popup is the same. Due to the way my script runs precompiling all simulation is not an option. I plan to run my simulation on a cluster so disabling the firewall is not an option either. Does anyone have any idea how to prevent this from happening? Matlab 2012B


Log in to comment.

2 Answers

Answer by Mike
on 15 Feb 2013
 Accepted Answer

I tried this but because the executable is being built in a different folder Windows Firewall treats it as a different program. Do you know of a method to add a blanket exemption for any file created by Matlab?

  1 Comment

I don't know how to add something specifically created by MATLAB, but there is a programmatic interface to the firewall settings in Windows. If you know the path and filename that's going to cause the dialog to come up, you could add it using "netsh". Here are some examples using "cmd.exe" -- you would need to replace that with the name of your executable. I'd imagine you could use a "system" call to set this, since they are one-liners.

netsh firewall add allowedprogram program=c:\windows\system32\cmd.exe enable

and then disable it using

netsh firewall add allowedprogram program=c:\windows\system32\cmd.exe disable

You can also delete the exception:

netsh firewall delete allowedprogram program=c:\windows\system32\cmd.exe

Note that there are a lot of switches and options, and I'd suggest reading the documentation here, and verifying the rules do what you want. It also looks like some of the commands are being depricated, as well.

Log in to comment.

Answer by Jason Ross
on 15 Feb 2013

You should be able to add an exception to the firewall and still keep the firewall running.


Log in to comment.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!