간단하게 실행파일 경로만 가져오는 법.



uses
  ShlObj, ActiveX;

function GetTargetExe(const LinkFileName: String): String;
var
  psl: IShellLink;
  ppf: IPersistFile;
  info: array [0..MAX_PATH] of Char;
  wfs: TWin32FindData;
begin
  Result:='';

  if not FileExists(LinkfileName) then Exit;

  CoCreateInstance(CLSID_SHELLLINK, nil, CLSCTX_INPROC_SERVER, IShellLink, psl);
  if psl.QueryInterface(IPersistFile, ppf)=0 then begin
    ppf.Load(PWideChar(LinkFileName), STGM_READ);
    psl.GetPath((@info), MAX_PATH, wfs, SLGP_UNCPRIORITY);
    Result:=info;
  end;  
end;


Posted by bloodguy
,