首先添加shlobj单元
procedure CreateLink(ExePath,LinkName:WideString);
var
tmpObject:IUnknown;
tmpSLink:IShellLink;
PIDL:PItemIDList;
tmpPFile:IPersistFile;
StartupDirectory:array[0..MAXPATH] of char;
LinkFileName:widestring;
begin
StartupFileName:=ExePath;
tmpObject:=CreateObject(CLSID_ShellLink);
tmpSLink:=tmpObject as IShellLink;
tmpPFile:=tmpObject as IPersistFile;
tmpSLink.SetPath(pchar(StartupFileName));
tmpSLink.SetWorkingDirectory(pchar(ExtractFilePath(StartupFileName)));
SHGetSpecialFolderLocation(0,CSIDL_DESKTOPDIRECTORY,PIDL);
SHGetPathFromIDList(PIDL,StartupDirectory);
LinkFileName:=StartupDirectory;
LinFileName:=LinkFileName+'\'+LinkName+'.lnk';
tmpFFile.Save(pchar(LinkFileName),FALSE);
end;