RayT
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()
How is this done using
File.SetAttributes()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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(inFileP ath)
attributes = (attributes And Not attributesToRemove)
File.SetAttributes(inFileP ath, attributes)
End Sub
Shared Sub RemoveAttribute(inFilePath
Dim attributes As FileAttributes = File.GetAttributes(inFileP
attributes = (attributes And Not attributesToRemove)
File.SetAttributes(inFileP
End Sub
Thanks for sharing your code Ray!
https://docs.microsoft.com/en-us/dotnet/api/system.io.file.setattributes?view=netframework-4.7.2