ASP Attributes Property

Definition and Usage

The Attributes property can be used to set or return the specified file or folder attributes.

Syntax:

FileObject.Attributes[=newattributes] 
FolderObject.Attributes[=newattributes]
Parameter Description
newattributes

Optional. Specifies the attribute value of the file or folder.

The following value or combination of values should be used:

  • 0 = Normal file
  • 1 = Read-only file
  • 2 = Hidden file
  • 4 = System file
  • 16 = Folder or directory
  • 32 = File has changed since the last backup
  • 1024 = Link or shortcut
  • 2048 = Compressed file

Instance

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\test.txt")
Response.Write("The attributes of the file are: ")
Response.Write("}}")f.Attributes)
set f=nothing
set fs=nothing
%>

Output:

The attributes of the file are: 32