Fn SetDirectoryAccessControlType inputDirectoryInfo =
(
tempUserName = (DotNetClass "System.Environment").UserName
fileSystemRights = (DotNetClass "System.Security.AccessControl.FileSystemRights").Modify
accessControlType = (DotNetClass "System.Security.AccessControl.AccessControlType").Allow
fileSystemAccessRule = DotNetObject "System.Security.AccessControl.FileSystemAccessRule" tempUserName fileSystemRights accessControlType
directorySecurity = inputDirectoryInfo .GetAccessControl()
directorySecurity.AddAccessRule fileSystemAccessRule
inputDirectoryInfo .SetAccessControl directorySecurity
)
Fn GetAllFiles targetPath fileFilter =
(
local SearchOption,DotNetDirectoryInfo
SearchOption = DotNetClass "System.IO.SearchOption"
DotNetDirectoryInfo = DotNetObject "System.IO.DirectoryInfo" targetPath
SetDirectoryAccessControlType DotNetDirectoryInfo
result = for tfi in (DotNetDirectoryInfo.GetFiles fileFilter SearchOption.AllDirectories) collect tfi.FullName
result
)
GetAllFiles "E:\\" "*"