SPECIAL OFFER        Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming!

⤷ Set/change file attributes

You may use SetFileAttributes function, if you want to set or change file attributes. This example shows, how to set FILE_HIDDEN attribute.

procedure TForm1.Button1Click(Sender: TObject);
begin
  with OpenDialog1 do
    if Execute then
      if SetFileAttributes(PChar(Filename), FILE_ATTRIBUTE_HIDDEN) then
        Caption:='attribute was changed'
      else
        Caption:='attribute was not changed';
end;
Related components
TFileSearch
TFolderMonitor
TFileVersion
More for developers
Databases for Amazon Associates
Amazon Categories
Amazon Nodes