MATLAB: Do I get an error about an Invalid MEX-file ver.dll when running the ver command on a Windows machine

MATLAB

I get the following error when trying to run ver on my Vista system.
??? Invalid MEX-file 'C:\Windows\system32\ver.dll': C:\Windows\system32\ver.dll is not a valid Win32 application.

Best Answer

This error indicates you are in a directory that contains a ver.dll file. Generally this is due to an incorrect "Start In" setting on your MATLAB shortcut.
As a workaround, change your MATLAB directory to one other than C:\Windows\system32.
For a permanent fix, adjust the "Start In" property in the MATLAB shortcut properties to another folder such as your My Documents directory. You can do this by right clicking on your shortcut and selecting "Properties".