Files Delphi

Title: How to change file attributes
procedure TForm1.Button1Click(Sender: TObject);
begin
FileSetAttr('C:\YourFile.ext', faHidden);
end;
{
Other Files Attributes:

}
{
faReadOnly $00000001 Schreibgesch¨¹tzte Datei
faHidden $00000002 Verborgene Datei
faSysFile $00000004 Systemdatei
faVolumeID $00000008 Laufwerks-ID
faDirectory $00000010 Verzeichnis
faArchive $00000020 Archivdatei
faAnyFile $0000003F Beliebige Datei
}
{
You can also set some attributes at once:

}
FileSetAttr('C:\Autoexec.bat', faReadOnly + faHidden);
{
To remove write protection on a file:

}
if (FileGetAttr(FileName) and faReadOnly) 0
then FileSetAttr(FileName, FileGetAttr(FileName) xor faReadOnly);
{
Re-Set write protection:
}
FileSetAttr(FileName, FileGetAttr(FileName) or faReadOnly);