No BSD License  

5.0

5.0 | 6 ratings Rate this file 33 Downloads (last 30 days) File Size: 590 Bytes File ID: #15885

Get user home directory

by

 

10 Aug 2007 (Updated )

get the user's home directory platform independent

| Watch this File

File Information
Description

GETUSERDIR returns the user home directory using the registry on windows systems and using Java on non windows systems as a string

COLLABORATION:
As I am not familiar with non windows operating systems please give me information about incompatibilities - I rely on JAVA in this function

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
06 Nov 2014 Michael Kutzer  
16 Oct 2014 David  
16 Oct 2014 David

thanks!

08 Feb 2012 Eric  
10 Aug 2008 Martin O'Reilly

Nice bit of code - just what I was looking for.

@ andy a: getenv('USERPROFILE') gets the root of your Windows profile. By default your "My Documents" folder will be directly under this root. Fowever, getenv('USERPROFILE') will not get your "My Documents" folder if you have changed it from the default (e.g. to another partition to separate data and operating system files).

23 Jul 2008 andy a

Why not just this

if ispc; userdir= getenv('USERPROFILE');
else; userdir= getenv('HOME');
end

19 Feb 2008 Javier Lopez

Nice!

Contact us