MATLAB: Does double-clicking on MDL-file or a FIG-file with a name longer than 9 characters fail to open the file in MATLAB 7.0.4 (R14SP2)

7.0.4doubl-clicklongMATLABnameopenrr14sp2regeditspace

When I double-click on an MDL-file or a FIG-file with name longer than 9 characters outside of MATLAB 7.0.4 (R14SP2), the model or figure never opens. I have MATLAB 7.0.4 (R14SP2) installed in a directory containing spaces. However, I do not see this issue with filenames whose lengths do not exceed 9 characters. I have the following set under the "Tools->Folder Options" for the MDL file extension:
D:\Program Files\MATLAB704\bin\win32\matlab.exe -r open('"%1"')

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
There is a bug in MATLAB 7.0.4 (R14SP2) in the way that double-clicking on MDL-file or a FIG-file with a name longer than 9 characters opens files. This issue is related to the registry settings created when there is a space in the installation path in MATLAB 7.0.4 (R14SP2).
To work around this issue:
Reinstall MATLAB 7.0.4(R14SP2) into a directory that does not have a space in the name.
OR
Edit two registry keys, by following these steps:
1. On the Windows Start menu, select Run and type 'regedit'. You can see all of the Program IDs for all of the programs on your system has registered under HKEY_CLASSES_ROOT.
2. Find the entries for the figfile and mdlfile commands:
HKEY_CLASSES_ROOT\mdlfile\Shell\open\command
HKEY_CLASSES_ROOT\figfile\Shell\open\command
3. Right click on the command and click on Modify.
Change the command:
D:\Program Files\MATLAB704\bin\win32\matlab.exe -r open('"%1"')
to enclose the full path of the command in quotes, like this:
"D:\Program Files\MATLAB704\bin\win32\matlab.exe" -r open('"%1"')