Utilities.FileSetAttr Method

Applies to TestComplete 14.10, last modified on June 5, 2019
This method is obsolete. See the Remarks section below.

Description

Use the Utilities.FileSetAttr method to set the attributes of the specified file. To address an attribute, use constants listed in the description of the FileGetAttr method. To combine several attributes, use the or operator. For instance, the following code makes the c:\MyFile.txt file read-only and hidden:

JavaScript, JScript

Utilities.FileSetAttr("C:\\MyFile.txt", Utilities.faReadOnly | Utilities.faHidden);

Python

Utilities.FileSetAttr("C:\\MyFile.txt", Utilities.faReadOnly | Utilities.faHidden)

VBScript

Utilities.FileSetAttr "C:\MyFile.txt", Utilities.faReadOnly Or Utilities.faHidden

DelphiScript

Utilities.FileSetAttr('C:\MyFile.txt', Utilities.faReadOnly or Utilities.faHidden);

C++Script, C#Script

Utilities["FileSetAttr"]("C:\\MyFile.txt", Utilities["faReadOnly"] | Utilities["faHidden"]);

Declaration

Utilities.FileSetAttr(FileNameAttr)

FileName [in]    Required    String    
Attr [in]    Required    Integer    
Result Integer

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

FileName

Specifies the file whose attributes you want to change.

Attr

Specifies the attributes to be set to the specified file.

Result Value

If the attributes have been set successfully, the function returns 0. Otherwise, it returns a Windows error code.

Remarks

This method is obsolete. It is supported for backward compatibility only. To set file’s attributes, use the aqFile.SetFileAttributes or aqFileInfo.SetFileAttributes method.

See Also

aqFile.SetFileAttributes Method
SetFileAttributes Method
aqFile.GetFileAttributes Method
Attributes Property
aqFileSystem.FindFiles Method
TSearchRec Object

Highlight search results