[SOLVED] How to copy files and or folders lazarus / 21-General ---------------------------------------------------------------------- What I can do · 2024-09-29 13:58 OS: Window 10 @64 FPC: Lazarus 3.4 USES: FileUtils SECURITY: everyone=Full Control Project: basic installer copy files and folder preset variables SourcePath:= "G:\t\DAD\Program Files\Lazarus\projectsession\Installer" aPath:="C:\Users\CatMasterDad\Desktop\test" Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i       CopyFile(SourcePath+'\Install.exe', aPath);  No errors, but nothing gets copied. ---------------------------------------------------------------------- Fibonacci · 2024-09-29 14:09 Missing filename in the second parameter (aPath). If test is a filename, then it probably already exists and is a directory not a file (a file would be probably overwritten) ---------------------------------------------------------------------- What I can do · 2024-09-29 14:22 Thanks Fibonacci for the reply but no it has no different effect changed  CopyFile(SourcePath+'\Install.exe', aPath);  to  CopyFile(SourcePath+'\Install.exe', aPath+'\Install.exe');  no difference, no errors, and no copy This is a very simple app, just new Application with TButton and SelectDirectoryDialog buttonclick Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   SelectDirectoryDialog1.Title:='Select TARGET Folers.';  if SelectDirectoryDialog1.Execute   then     begin      FeedBack.Caption:='Statred coping files...';      Screen.Cursor:=crHourGlass;      aPath:=SelectDirectoryDialog1.FileName;      FeedBack.Caption:='Launch editor...';      CopyFile(SourcePath+'\Install.exe', aPath+'\Install.exe');      CopyFile(SourcePath+'\I.bat', aPath+'\I.bat',TRUE);      CopyDirTree(SourcePath+'\Icons',aPath);     LaunchEXE(SourcePath+'I.bat' ,aPath);      FeedBack.Caption:='DONE!';      ShowMSG('DONE!');     end; Screen.Cursor:=crDefault; halt;end; that's it the whole app ---------------------------------------------------------------------- Fibonacci · 2024-09-29 14:37 Works perfectly fine, even checked copying between disks. Try running as admin or changing paths to see if its a permission issue. ---------------------------------------------------------------------- What I can do · 2024-09-29 15:27 Ok, thank you. that gives me the  knowledge that it works so all I have to do is hack around with different stuff. I tried different paths and drives but still no copy. I wish I got some form of error at the least. I don't have the Admin PW but my account is in Administrators and given Full Control Thank you for all your help. ---------------------------------------------------------------------- Ally · 2024-09-29 16:14 The DirectorySeparator may be the problem. Under Windows \ and under Linux / This could work under Windows as well as under Linux (untested): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i aSource := AppendPathDelim('C:') + AppendPathDelim('Source');aDest := AppendPathDelim('C:') + AppendPathDelim('Dest'); CopyFile(aSource + 'Install.exe', aDest + 'Install.exe'); ---------------------------------------------------------------------- Thaddy · 2024-09-29 16:17 Quote from: Ally on September 29, 2024, 06:14:51 pmThe DirectorySeparator may be the problem. Under Windows \ and under Linux / Under Windows, both / and \ are allowed, but Linux is indeed / only. ---------------------------------------------------------------------- What I can do · 2024-09-29 22:19 OK, Found IT! It is the master partition on a new jump drive. That's as far as I went. I just cleaned an old Jump drive and Copies great now. and I thank you all but hats to  Fibonocci for testing my code and assured me it was successful. That gave me the confidence to rip into so of speak.