No BSD License  

Highlights from
Get user home directory

5.0

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

Get user home directory

by Sven Probst

 

10 Aug 2007 (Updated 10 Aug 2007)

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  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
19 Feb 2008 Javier Lopez

Nice!

23 Jul 2008 andy a

Why not just this

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

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).

08 Feb 2012 Eric  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
path Sven Probst 22 Oct 2008 09:22:44
directories Sven Probst 22 Oct 2008 09:22:44
files Sven Probst 22 Oct 2008 09:22:44
home user myfiles eigene dateien registry Sven Probst 22 Oct 2008 09:22:44

Contact us at files@mathworks.com