getTargetFromLink

Extract the target of a Windows shell link shortcut (LNK)
ダウンロード: 570
更新 2016/9/1

ライセンスの表示

SYNTAX:
target = getTargetFromLink(lnkFile)
Creates the requisite actxserver, extracts the target.
[target,aserver] = getTargetFromLink(lnkFile) also passes out a handle to the Activex server object

[target,...] = getTargetFromLink(lnkFile,aserver) allows optional passing in of Activex server object. (If you are calling getTargetFromLink many times, it can be faster to create the Activex server object, aserver, one time, and pass it in. Otherwise, this is pretty fast.)

EXAMPLES:
Example 1: Get a single target

links = dir('*.lnk');
target = getTargetFromLink(links(1).name)

Example 2: Get many targets, re-using the asvr (optional)

links = dir('*.lnk');
target = cell(numel(links),1);
[target{1},asvr] = getTargetFromLink(links(1).name);
for ii = 2:numel(links)-1
target{ii} = getTargetFromLink(links(ii).name,asvr);
end

Example 3: To get the link to a file not in the current directory, specify the fullfile to the link:

links = dir('c:\myLinks\*.lnk');
target = getTargetFromLink(fullfile('c:\myLinks',links(1).name))

NOTES: To create links, file createLinks (available on the MATLAB Central File Exchange) might be useful.

引用

Brett Shoelson (2024). getTargetFromLink (https://www.mathworks.com/matlabcentral/fileexchange/34949-gettargetfromlink), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2011b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersActiveX についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.1

Updated license

1.0.0.0