Jump to content
Sign in to follow this  
ffdshow

FileSetAttrib problem

Recommended Posts

DaRam

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
ffdshow

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.