Jump to content

FileSetAttrib problem


Recommended Posts

You want to remove all attributes set right?

You do not need to iterate through each attribute Just use this:

$attrib = FileGetAttrib(@HomeDrive & "\file")
FileSetAttrib(@HomeDrive & "\file", "-" & $attrib)

If you do not care about what attributes are already set and just want to remove all then

FileSetAttrib(@HomeDrive & "\file", "-RASHNOT")

Edit: You cannot set the D (DIRECTORY) AND C (COMPRESSED) Atttributes, so the first method could fail if applied to a file with these attributes set.

Edited by DaRam
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...