#define FILE_ATTRIBUTE_READONLY 0x00000001 #define FILE_ATTRIBUTE_HIDDEN 0x00000002 #define FILE_ATTRIBUTE_SYSTEM 0x00000004 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020 #define FILE_ATTRIBUTE_ENCRYPTED 0x00000040 #define FILE_ATTRIBUTE_NORMAL 0x00000080 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100 #define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800 #define FILE_ATTRIBUTE_OFFLINE 0x00001000 #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 declare integer SetFileAttributes in win32api ; String lpFileName, ; && file name integer dwFileAttributes && attributes declare integer GetFileAttributes in win32api ; String lpFileName && name of file or directory * sets it read only SetFileAttributes( "C:\isql.bat", bitor( GetFileAttributes( "C:\isql.bat" ), FILE_ATTRIBUTE_READONLY ) ) * unsets readonly SetFileAttributes( "C:\isql.bat", bitand( GetFileAttributes( "C:\isql.bat" ), bitnot( FILE_ATTRIBUTE_READONLY ) ) )>I think it might be easier changing the attributes of the files in a folder. The code below does this for C:\test folder.
>DECLARE INTEGER SetFileAttributes IN kernel32.dll; > STRING @ lpFileName,; > INTEGER dwFileAttributes > >#DEFINE FILE_ATTRIBUTE_NORMAL 0x0080 >#DEFINE FILE_ATTRIBUTE_READONLY 0x0001 > >SET DEFAULT TO C:\test >lnNumFiles = ADIR(FileList,'*.*') > >FOR t = 1 TO lnNumFiles > =SetFileAttributes(FileList[t,1], FILE_ATTRIBUTE_READONLY) >ENDFOR >