to cytown:nt和98的路径是不一样的,<br>function tform1.GetSpecialFolder: string;<br>var<br> Pidl: PItemIDList;<br> handle : THandle;<br> Comp: TComponent;<br> LinkDir : string;<br>begin<br> // Get the folder location (as a PItemIDList)<br> result:='';<br> Comp := self.owner;<br> handle := (Comp as TForm).handle;<br> if SUCCEEDED(SHGetSpecialFolderLocation(handle, CSIDL_APPDATA, Pidl)) then begin<br> //other placeid is CSIDL_DESKTOP,CSIDL_NETHOOD,CSIDL_PRINTHOOD,<br>//CSIDL_PROGRAMS,CSIDL_SENDTO,CSIDL_STARTMENU,CSIDL_STARTUP <br> // Get the actual path of the desktop directory from the PItemIDList<br> SetLength(LinkDir, MAX_PATH); // SHGetPathFromIDList assumes MAX_PATH buffer<br> SHGetPathFromIDList(Pidl, PChar(LinkDir)); // Do it<br> SetLength(LinkDir, StrLen(PChar(LinkDir)));<br> result:=linkdir+'/';//if not CSIDL_APPDATA<br> result := LinkDir+'/Microsoft/Internet Explorer/Quick Launch/';//if CSIDL_APPDATA<br> end;<br>end;<br>再用shelllink得到IPersistFile.save(GetSpecialFolder+linkfilename);<br>