[SOLVED] ForceDirectories in Lazarus 64 bits problems... lazarus / 34-Windows ---------------------------------------------------------------------- Fred vS · 2011-09-21 20:55 Hello everybody. I have troubles with ForceDirectories in Lazarus 64 bits : the directory is not created  Here a sample to demonstrate it : Create a new application with a button : Code: [Select]unit Unitcreatedir; {$mode objfpc}{$H+} interface uses SysUtils, Forms, Dialogs, StdCtrls;  type   { TForm1 }   TForm1 = class(TForm)     Button1: TButton;   procedure Button1Click(Sender: TObject);   private     { private declarations }   public     { public declarations }   end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject); begin     MessageDlg('Init of testing'  ,mtInformation, [mbYes], 0)  ;   if DirectoryExists(pchar('C:\Program Files\test')) then else        ForceDirectories(pchar('C:\Program Files\test'));    if DirectoryExists(pchar('C:\Program Files\test')) then    MessageDlg('\test\ exists...'  ,mtInformation, [mbYes], 0)    else MessageDlg('\test\ do not exist...'  ,mtWarning, [mbYes], 0) ;  if DirectoryExists(pchar('C:\Program Files\test')) then  removedir(pchar('C:\Program Files\test')) ; end; end. With Lazarus 32 bits, the directory test is created.  With Lazarus 64 bits, the directory test is NOT created.  Thanks for helping... ---------------------------------------------------------------------- typo · 2011-09-21 21:32 Try the BugTracker. ---------------------------------------------------------------------- Fred vS · 2011-09-22 01:43 @ Typo I do not know how to use Bugtracker, i do not find how to add a new bug ... ---------------------------------------------------------------------- BigChimp · 2011-09-22 09:23 IIRC, the button/link is called something like "Report an issue". I think you need to have an account on the bugtracker first. ---------------------------------------------------------------------- JohnvdWaeter · 2011-09-22 11:35 I *think* it's a windows issue... the folder is probably not really created below Program Files. It's only made visible there for users and programs, but creating folders in the program-folders directory is normally forbidden, except for elevated setup-programs. Windows  more or less allowed the creation, but these folders are created in the users virtual space. I think Win64 bit version simply does not allow it anymore. To see if 64 bit Forcedirectories work, try to create a folder manually (in Explorer) like C:\test Then grant proper rights to this folder. Now try if 64 bits lazarus prog can create folders inside this c:\test fwiw ;-) John ---------------------------------------------------------------------- Fred vS · 2011-09-22 13:41 @ John Hum, it is just what im thinking. OK, the answer is : forget to create folders or directories in C:\program files with Windows 7. I gonna change it to C:\myprogram_data (there no problems).  Thanks ---------------------------------------------------------------------- User137 · 2011-09-22 14:50 Windows lets you have spaces in path names sometimes only if full path is in " ".