This read-only property specifies the attributes of the object.
Syntax
ReplicationItem.Attributes
Remarks
The attributes are defined in Winnt.h.
Attribute name | Value | Description |
FILE_ATTRIBUTE_READONLY | 1 (0x1) |
The item has the read-only bit set. |
FILE_ATTRIBUTE_HIDDEN | 2 (0x2) |
The item has the hidden bit set. |
FILE_ATTRIBUTE_SYSTEM | 4 (0x4) |
The item has the system bit set. |
FILE_ATTRIBUTE_DIRECTORY | 16 (0x10) |
The item is a directory. |
FILE_ATTRIBUTE_ARCHIVE | 32 (0x20) |
The item has the archive bit set. |
FILE_ATTRIBUTE_ENCRYPTED | 64 (0x40) |
The item is encrypted. |
FILE_ATTRIBUTE_NORMAL | 128 (0x80) |
The item is a normal file or directory. |
FILE_ATTRIBUTE_TEMPORARY | 256 (0x100) |
The item is a temporary directory. |
FILE_ATTRIBUTE_SPARSE_FILE | 512 (0x200) |
The item is a sparse file. |
FILE_ATTRIBUTE_REPARSE_POINT | 1024 (0x400) |
The item is a reparse point. |
FILE_ATTRIBUTE_COMPRESSED | 2048 (0x800) |
The item is a compressed file or directory. |
FILE_ATTRIBUTE_OFFLINE | 4096 (0x1000) |
The item is not available. |
If the FILE_ATTRIBUTE_DIRECTORY attribute is not set, the ReplicationItem object is a file. If the ReplicationItem object is a file, Attributes contains the file attributes. If the ReplicationItem is not a file, it is a metabase item.
Example
The following example displays the attributes of the replication items in the \LocalProj directory for the Test project.
Option Explicit
On Error Resume Next
const OPEN_EXISTING_PROJECT = 2
const CRS_ERROR_NO_MORE_ITEMS = 0&80003B17
dim ReplServer
set ReplServer = CreateObject("Crsapi.ReplicationServer")
ReplServer.Initialize("")
dim Project
set Project = ReplServer.OpenProject("Test", OPEN_EXISTING_PROJECT)
Dim ReplItem
dim Iterator
Iterator = 0
dim ReplError
do while True
'Clear any error text
Err.Clear
'Get the next replication item
set ReplItem = Project.EnumItems "\LocalProj", Iterator
'Display error message and quit if empty object returned
if IsEmpty(ReplInst) then
Wscript.Echo "Empty replication item returned."
exit do
end if
'Quit if "No more items" error
ReplError = Err.Number
if ReplError = CRS_ERROR_NO_MORE_ITEMS then exit do
Wscript.Echo "Name: " & ReplItem.Name
Wscript.Echo "Attributes: " & ReplItem.Attributes
Wscript.Echo "Creation time: " & ReplItem.CreationTime
Wscript.Echo "Last access time: " & ReplItem.LastAccessTime
Wscript.Echo "Last modified time: " & ReplItem.LastModifiedTime
dim size
size = ReplItem.SizeHigh + ReplItem.SizeLow
Wscript.Echo "Size: " & size & " (bytes)"
Loop
'Release objects
set ReplInst = Nothing
set ReplProject = Nothing
set ReplServer = Nothing
See Also
Name, ReplicationProject.EnumItems