File Exchange

image thumbnail


version (2.34 KB) by Brett Shoelson
Create Windows shell link (.LNK) shortcuts, given a specified file format

1 Download

Updated 01 Sep 2016

View License

creates Windows shell link (.lnk) shortcuts to files specified by extensions in filterspec, for files in directory startDirName, including or excluding subdirectories, and writing links to directory linkToDirName.

a cell array of extensions to include. Specify filterspec as: {'*.ext1';'*.ext2';'*ext3';...;'*.extn'}.

(NOTE: See help for UIGETFILE for a
discussion of filterspec.)

startDirName: the top-level directory from which to start searching for files to link. Default = pwd;

recurse: Logical (t/f); do you want to recurse (include sub-directories)? Default = false;

linkToDirName: The name of the directory in which you want to put the shortcuts. Default = pwd.

Example 1: To create, in the current directory, links to all JPG or TIFF files in the current directory:


Example 2: To create links to all files of type *.m in directory 'c:\mfiles', recursively, and place the links in directory 'c:\myMfileLinks':


NOTE: To EXTRACT the target name from the links, file getTargetFromLink might be useful. (It is available on the MATLAB Central File Exchange.)

Cite As

Brett Shoelson (2020). createLinks (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)


Updated license

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux