Can anyone solve Windows giving error "There was a problem sending the command to the program" when opening Matlab script?
Show older comments
Whenever I try to open a script in the File Explorer, Windows gives the error "There was a problem sending the command to the program." Does anyone have any experience solving this problem? Below, you will find a more detailed description of the problem.
I recently built a new PC. Since installing Matlab on the new PC, I have not been able to open scripts directly from the File Explorer. If I try to open them from the File Explorer, I receive the error "There was a problem sending the command to the program." This occurs whether Matlab is open already or not. Currently, the only way I can open scripts is directly through Matlab. I have tried trouble shooting techniques such as deassociating and reassociating Matlab filetypes, reinstalling Matlab, and running Matlab in compatibility mode.
If it helps, these are the specs of my new PC: i7-4790k @ 4.4 GHz CPU, 32gb DDR3 2400 MHz Corsair Vengeance Pro RAM, MSI z97 Gaming 5 Motherboard,and a MSI GTX 1080 Gaming X GPU.
Additionally, I am trying to run Matlab from a different drive (a Samsung 850 PRO 128gb SSD) than I am storing the scripts on (a WD Black 2 TB 7200 RPM HDD). However, I did not think this could be causing the issue because all of my other programs on the 128gb SSD open files just fine.
14 Comments
Jean-Marie Sainthillier
on 18 Oct 2016
Do you have the same problem with other Matlab extensions (.mat, .fig, ...). Do you have the Matlab Editor selected in the preferences ?
Boaz Arad
on 6 Nov 2016
I'm suffering from a similar problem on similar hardware and yes - double clicking any file associated with Matlab (.m, .mat etc) produces the same error.
Re-association/re-installation did not help.
Boaz Arad
on 7 Nov 2016
I'm running windows 10, and yes - double clicking a file in windows explorer produces the error. This does not seem to be a windows 10 issue though, as other machines running windows 10 do not share the problem.
Kazem Alidoost
on 10 Nov 2016
I'm having the exact same problem - it started earlier today and I've taken similar steps to the author with no success
Chip Audette
on 31 Dec 2016
I'm also having this problem. Windows10. Matlab R2015b.
Walter Roberson
on 31 Dec 2016
Does it help to specifically register MATLAB as a server?
Jan
on 1 Jan 2017
@Chip: Which problem do you exactly have? Do you want to start a script by a double click in the Windows Explorer? Or should it be opened in the editor?
Chip Audette
on 5 Jan 2017
Hi, @Jan, thanks for the reply. I simply want to open the script by double-clicking on it in Windows. Just like double-clicking on a Word document causes Word to launch and open the file. Double-clicking on an m-file used to open the m-file in Matlab. Now, since Win10, I get the Windows error stated in the original post.
Chip Audette
on 5 Jan 2017
@Walter: I just executed both sets of instructions -- both the automation server and the file association fix. Sadly, these attempts had no effect. I still get the Windows error when double-clicking on an m-file.
Walter Roberson
on 5 Jan 2017
Chip Audette
on 6 Jan 2017
@Walter, Thanks for the suggestions. I had tried many of these changes before coming here to Matlab Answers.
Specifically, I spent a lot of time with the DDE-based approaches. I found that, if I opened my registry and removed the DDE entry with the m-file association, I no longer got the error when double-clicking on an m-file. It would successfully launch Matlab without error.
While that sounds good, it was not. Sure, Matlab would start, but it wouldn't actually open my m-file. Without the DDE communication, it didn't know to open the file. So, it didn't open the file. Therefore, this is not a solution. :(
It does, however, point to the DDE communication as being part of the problem. Thoughts?
Walter Roberson
on 6 Jan 2017
sorry, I do not know enough about MS Windows to have further suggestions.
Francisco Monteiro
on 19 May 2017
I'm using version 2017a (on two Windows 10 64-bits machines) and I'm also, once again, getting the system error: "there was a problem while sending the command to the program" when I try to call an m.file i.e., double clicking an m-file. This is extremely annoying and unproductive.
I had this problem with 2015b. At the time I interacted with Support but what they told me was that it was a problem you were working on and that is seamed that the operating system was not responding fast enough to MATLAB and that would trigger the problem. It was very weird because both computers are extremely recent and one of them is even top-specs. Some months ago I upgraded to v. 2017a on both computers and both started working perfectly well again. Now, after a few month of everyday use, the problem is again appearing with 2017a in one of the computers. I contacted Support and they gave three options to try to solve the problem but unfortunately none of them has worked out.
- One possible reason for this unexpected behavior is that there are incorrect values and keys in the Windows Registry Editor.
STEP 1: ------------ You need to obtain information about the registry values on the machine experiencing the issues. To do this, do the following: 1. Open up the registry editor by pressing the windows key and searching "regedit", then press enter.
2. On the left side of Registry Editor there will be a directory tree, traverse to the following directory: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\DDECache\ShellVerbs.MATLAB.9.1.0\system
3. Once in that directory you should see some information in the right hand pane. Expand the columns to fully show the values and take a screenshot of the Registry Editor.
4. Then, traverse to the following two directories in the Registry Editor and take screenshots for both: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.m\OpenWithList HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.m\OpenWithProgids
STEP 2: ------------ You now need to compare the registry values for those three keys on a machine that does not experience this issue.
If any of the keys contain different values or the keys are missing entirely, make changes to the problem machines registry editor. Then reboot the system and try and reproduce the issue. It should be solved.
They told me that they have seen cases when the above steps did not help.
- In these cases they told me that the TrendMicro OfficeScan (antivirus software) was in use. After the uninstalling it, the file associations for MATLAB worked at one machine immediately.Then the antivirus software could be reinstalled and still it worked. It is perfectly possible that other antivirus software could cause this, too.
- They also told me that another possible cause of this issue is that Windows sometimes does not associate MATLAB file types with the correct executable file. Then Support told me that a possible workaround was to manually select the MATLAB executable in the bin subfolder as the executable to run when selecting .m files.
- The last workaround Support told me was to launch MATLAB and try opening the MATLAB code files from the MATLAB GUI (which is not actually a workaround but living with the problem, as we know, and is what I always have to end up doing.)
i) I noted that several keys were different in those three registry's folders. In the end I ended up exporting the three of them one-by-one from the computer that works well to the one with having the problem. I compared all the keys in the end and I cam sure they are all the same on moth computers (i.e., they both have the keys of the computer that works). In short, the keys that were missing were added and the ones that existed were all replaced by the good ones.
ii) I have also manually associated the .m files to the matlab\bin\matlab.exe executable.
iii) I do not use TrendMicro OfficeScan, but just to be sure I looked for it using the search tool and I even checked if there was any program running with that name in the Task Manager. I have no other antivirus installed apart from the Windows 10 embedded Windows Defender. But in my other computer also has Windows Defender and it works fine.
Sadly nothing changed the situation: m files (or .mlx for live scripts) continue to trigger the error "there was a problem while sending the command to the program"
In the mean time I fully installed MATLAB, including the 50 toolboxes I have with my university licence, and even manually deleted all the directories and files. Then I re-installed MATLAB entirely (downloaded installer from my Mathworks account, etc). To no avail. It persists not opening the .m files by double clicking them. I tried everything I've read and was told so far...!
To sum up, I spent one year with this problem during 2016 (really annoying, and daily I was even avoiding turning MATLAB on).It totally breaks the work flow of those working with several .m files stored in different locations (in my case files for lecturing, files of my own research, files from my graduate students' research, etc).
My system is a Windows 10 Education, and from what I read about the different windows versions, the Edu version has the media feature package already included, so that should not also be the problem.
I think Mathworks should create some task force to help the Windows 10 many users to whom this extremely annoying problem is recurrent throughout MATLAB versions.
Answers (3)
Jan
on 6 Jan 2017
0 votes
2 Comments
Walter Roberson
on 6 Jan 2017
Yes, Chip said specifically that they did. http://www.mathworks.com/matlabcentral/answers/307707-can-anyone-solve-windows-giving-error-there-was-a-problem-sending-the-command-to-the-program-when#comment_418270
Jan
on 9 Jan 2017
Perhaps Henry tried this also?
Juan Carlos Barbero Del Olmo
on 23 Feb 2017
0 votes
Hello everybody, I´m new in this forum and I´ve had the same problem.
I´ve fixed it and I want to share the solution of my problem.
In my case, I was trying to open a script "example.m" double clicking it but it didn´t work, it was strange because it was working before in Windows 10, I only made a fresh reinstalling of it. Then I realised that I have The Windows 10 Pro N version. The sufix N means that I don´t have preinstalled the Media Feature Pack.
In my former version of windows I installed this pack and everything worked fine, so I tried to install it again (I warn you, install it is a pain in the neck because there are a lot of "packs" that don´t work) and everything worked again.
To sum up, the solution could be installing the media feature pack for your version of windows. For versions Pro N and Pro KN is the pack which can be downloaded from the following source:
I hope this could be useful.
Greetings.
Juan Carlos.
Vseslav Key
on 29 Oct 2021
Edited: Vseslav Key
on 29 Oct 2021
0 votes
It helped me the use of the WinTruster program with the subsequent reinstalling window 10 with the preservation of installed programs.
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!