//取得桌面目录
function getDesktopPath():String;
var
Reg:TRegistry;
DesktopPath:String;
begin
Reg:=TRegistry.Create;
try
Reg.RootKey:=HKEY_CURRENT_USER;
Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',False);
if Reg.ValueExists('Desktop') then DesktopPath:=Reg.ReadString('Desktop');
文章来源于领测软件测试网 https://www.ltesting.net/