File.SetPermissions

number File.SetPermissions ( 

string Filename,

string UserSID = SID_EVERYBODY,

number AccessMode = SET_ACCESS,

number Permissions = ALL_PERMISSIONS,

number Inheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT )

Example 1

-- Set the permissions of the file to everyone.
strCommonProductFile = Shell.GetFolder(SHF_APPLICATIONDATA_COMMON).."\\MyFile.txt";
File.SetPermissions(strCommonProductFile, SID_EVERYBODY, SET_ACCESS, ALL_PERMISSIONS, SUB_CONTAINERS_AND_OBJECTS_INHERIT);

Sets the permissions of the file "MyFile.txt" located in the common application data folder to full access permissions by everyone.

Example 2

-- Set the permissions of the product folder in application data common to everyone.
strCommonProductFolder = Shell.GetFolder(SHF_APPLICATIONDATA_COMMON).."\\MyProductFolder";
File.SetPermissions(strCommonProductFolder, SID_EVERYBODY, SET_ACCESS, ALL_PERMISSIONS, SUB_CONTAINERS_AND_OBJECTS_INHERIT);

Sets the permissions of the folder "MyProductFolder" located in the common application data folder to full access permissions by everyone.

See also:  Related Actions