Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Shortcuts and links in windows
Date: Fri, 16 Jan 2009 13:59:02 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 25
Message-ID: <gkq3r6$96i$1@fred.mathworks.com>
References: <gkpnuh$dpm$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1232114342 9426 172.30.248.35 (16 Jan 2009 13:59:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 Jan 2009 13:59:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869871
Xref: news.mathworks.com comp.soft-sys.matlab:512024


"Adam" <a.mcnamara@surrey.ac.uk> wrote in message <gkpnuh$dpm$1@fred.mathworks.com>...
> Hiya, I just had to move onto a windows platform at short notice. How do I get MATLAB to read via links on the windows system?
> 
> i.e.,
> 
> load C:\MRI\carrot_stick\data.mat
> 
> works fine but if I make a link (shortcut) in the windows file browser called carrot_stick under the MRI directory, then MATLAB only reads the link as a file. Is there a way to set up links within MATLAB to bypass this behaviour of windows?
> 
> Many thanks for any suggestions,
> 
> Adam 

Adam,

You can use Java inside MATLAB.

On Windows, shortcuts should have an extension .lnk

>> x = java.io.File('C:\MRI\carrot_stick.lnk')
>> y = sun.awt.shell.ShellFolder.getShellFolder(x)
>> actualDirectoryName = y.getLinkLocation()
>> load(fullfile(char(actualDirectoryName), 'data.mat'))

jiro