Attrib Class

MSBuild

Changes the attributes of files and/or directories


Namespace: MSBuild.Community.Tasks
Assembly: MSBuild.Community.Tasks (in MSBuild.Community.Tasks.dll)

Syntax

Visual Basic (Declaration)
Public Class Attrib
    Inherits Task
C#
public class Attrib : Task
C++
ref class Attrib : Task
J#
public class Attrib extends Task
JScript
public class Attrib extends Task

Example

Make file Readonly, Hidden and System.

 Copy Code
            <Attrib Files="Test\version.txt" 
                ReadOnly="true" Hidden="true" System="true"/>
            

Clear Hidden and System attributes.

 Copy Code
            <Attrib Files="Test\version.txt" 
                Hidden="false" System="false"/>
            

Make file Normal.

 Copy Code
            <Attrib Files="Test\version.txt" 
                Normal="true"/>
            

Inheritance Hierarchy

System.Object
   Microsoft.Build.Utilities.Task
      MSBuild.Community.Tasks.Attrib

Thread Safety

Public static (Shared in Visual Basic)staticShared members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

See Also

Syntax based on .NET Framework version 2.0.
Documentation version 1.0.0.0.