How can I remove the directory created upon startup in 'My Documents'?

5 views (last 30 days)
It appears that MATLAB creates a directory at "C:\My Documents\MATLAB".
I would like to remove this directory. I tried the following two things without success:
1. The DOS command - 'rm' using the BANG (!) operator returns the following error
at the MATLAB command prompt,
Access Denied.
2. If I modify the startup directory as follows:
a. Right click on the MATLAB shortcut on the desktop. Select Properties.
b. For Target, type "$MATLABROOT\R2007b\bin\matlab.exe" -sd myStartupDirectoryPath.
and launch MATLAB using this desktop shortcut, MATLAB starts in myStartupDirectory but still creates a folder 'MATLAB' in the default Windows 'My documents'.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
For MATLAB 7.6 (R2008a), follow the steps listed below.
- Start MATLAB
- Go to File-->Set Path...
- In the MATLAB search path window, highlight the default directory you want removed, e.g. "C:\My Documents\MATLAB"
- Click Remove
- Click Save
- Click Close
- Manually delete the default directory
- The next time MATLAB restarts, it should no longer create that directory
For MATLAB 7.5 (R2007b), put the following MATLAB script file in your startup directory:
x=pwd;
cd('$yourMyDocumentsPath\')
!rmdir MATLAB
cd(x);
where $yourMyDocumentsPath is your My Documents directory. Run this script file after starting MATLAB. The above script will delete the 'MATLAB' folder in 'My Documents' when the session of MATLAB is ended.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2008a

Community Treasure Hunt

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

Start Hunting!