Jump to content

Recommended Posts

Posted (edited)

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
Posted

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

I want to add some lines to the end of that file and then to restore all attributes.

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
×
×
  • Create New...