MATLAB starting up in C:\Windows\system32

I have several MATLAB versions installed on a given computer
  • R2011a (64-bit)
  • R2011b (64-bit)
  • R2012a (32-bit)
  • R2012b (64-bit)
Something changed in the background and now the first three versions above always start up in the C:\Windows\system32 folder, as opposed to my HOME/MATLAB directory.
Furthermore, in the R2012a version, the VER command does not work, giving an error "MEX file entry point is missing"
Error in ver(line 36)
locDisplayMatlabInformation
What might I have done to corrupt things? How do I uncorrupt them?
Thanks.

5 Comments

Did you somehow manage to lose matlabrc.m?
No, I can find it fine with
>>which matlabrc
However, in case it sheds any light, I tried doing
>>restoredefaultpath, savepath
and this failed with the message
Warning: Unable to save path to file 'C:\Program Files\MATLAB\R2011a\toolbox\local\pathdef.m'. You can save your path to a different location by calling SAVEPATH
with an input argument that specifies the full path. For MATLAB to use that path in future sessions, save the path to 'pathdef.m' in your MATLAB startup folder.
> In savepath at 162
That sounds like a protection/permission problem.
I did a complete clean and re-install and it still didn't fix it!
Time to go to Tech Support, I guess...
What does
userpath
return? It might be pointing to 'C:\Windows\system32'

Sign in to comment.

 Accepted Answer

What does userpath return?
Good call, Suneesh. USERPATH returned an empty string. By doing
userpath('reset')
everything is back to normal now.
I still wonder if anyone has any ideas why restoredefaultpath() didn't accomplish the same thing. And, of course, why re-installing didn't fix it as well!

More Answers (2)

RunAs administrator, restoredefaultpath, savepath, then exit. After that use it normally.

1 Comment

Matt J
Matt J on 12 Dec 2013
Edited: Matt J on 12 Dec 2013
Hi Walter,
Running as admin did get rid of the error savepath was giving me, but after exiting/restarting, I'm still in the system32 directory. My path was already factory default, it looks like.

Sign in to comment.

Look at the properties of the MATLAB icon that you click to run it. Is the "Start in" field blank like mine? Or is it C:\Windows\system32?

3 Comments

All my "Start in:" fields are blank.
I have a folder name in my "Start in:" field. If Matlab does not find that folder it makes C:\Windows\system32 the current folder.
Matt J
Matt J on 13 Dec 2013
Edited: Matt J on 13 Dec 2013
@per: I assume you mean that when you enter a non-existent folder, this happens. But surely when you make "Start in:" blank, it starts normally.

Sign in to comment.

Categories

Asked:

on 11 Dec 2013

Commented:

on 10 Mar 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!