Sign in to follow this  
Followers 0
ffdshow

FileSetAttrib problem

4 posts in this topic




#2 ·  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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0