Link to home
Start Free TrialLog in
Avatar of RayT
RayTFlag for United States of America

asked on

Resetting the archive bit on a specific file

How do reset the archive bit on a specific file using Visual Basic?

How is this done using

                File.SetAttributes()
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RayT

ASKER

Thanks!  It worked.  Here's the sub I ended up creating.  I'm a reusable code junkie :)

    Shared Sub RemoveAttribute(inFilePath As String, attributesToRemove As FileAttributes)
        Dim attributes As FileAttributes = File.GetAttributes(inFilePath)

        attributes = (attributes And Not attributesToRemove)

        File.SetAttributes(inFilePath, attributes)
    End Sub
Thanks for sharing your code Ray!