Function GetWinDir : string; var s : string[255]; p : pChar; begin integer(p) := integer(@s) + 1; byte(s[0]) := windows.GetWindowsDirectory(p, SizeOf(s)); Result := s; end;