if (Length (Temp) <= 0) or (Length (Temp) > 30) or (Pos (' ', Temp) > 0) or (Pos ('TEMP', UpperCase (Temp)) <= 0) then begin GetWindowsDirectory (TempDir, SizeOf (TempDir)); Temp := WithBackslash (AnsiString (TempDir)) + 'TEMP\'; if not DirExists (Temp) then try MkDir (Temp); except end; end;