Sign in to follow this  
Followers 0
Endgame

Setting File Attributes for Entire Drive

12 posts in this topic

I am attempting to remove the archive file attribute for all files on a hard drive. I am using the following code:

FileSetAttrib("C:\","-A",1)

When I use this code, nothing seems to happen. Any suggestions?

Share this post


Link to post
Share on other sites



I am attempting to remove the archive file attribute for all files on a hard drive. I am using the following code:

FileSetAttrib("C:\","-A",1)

When I use this code, nothing seems to happen. Any suggestions?

Surely it should be

FileSetAttrib("C:\*.*","-A",1)


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Surely it should be

FileSetAttrib("C:\*.*","-A",1)
That's what I thought as well but when I tried it, it did not recurse beyond the root of C:\.

Share this post


Link to post
Share on other sites

I wouldn't imagine that running past the current directory personally...

You could always do a recursive search for all directories and do a For/Next loop.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I wouldn't imagine that running past the current directory personally...

Why not ? The help file indicates that it should.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I wouldn't imagine that running past the current directory personally...

You could always do a recursive search for all directories and do a For/Next loop.

I was initially going to use a recursive loop to perform the task but when it stated in the help that is was recursive itself, I figured that would solve the problem. Apparently not.

Edited by Endgame

Share this post


Link to post
Share on other sites

Why not ? The help file indicates that it should.

Yep, that's what I get for replying to a topic on a function I've never used :lmao:

;make all .bmp files in C:\ and sub-directories writable and archived

FileSetAttrib("C:\*.bmp", "-R+A", 1)

If @error Then MsgBox(4096,"Error", "Problem setting attributes."

By the way, am I the only one that the ')' bracket is missing on the end of the MsgBox()?

Anyway... without trying to stick my foot in my mouth again on a function I've not used...

So a question... on the +- options... if '+A' archives them, I'm assuming that '-A' removes them from archive?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

By the way, am I the only one that the ')' bracket is missing on the end of the MsgBox()?

Nope.

So a question... on the +- options... if '+A' archives them, I'm assuming that '-A' removes them from archive?

That's exactly correct.

Share this post


Link to post
Share on other sites

By the way, am I the only one that the ')' bracket is missing on the end of the MsgBox()?

Obviously a typo in the help file, we can forgive that in such a good help file. :lmao:

So a question... on the +- options... if '+A' archives them, I'm assuming that '-A' removes them from archive?

That is what the help file says. ;)


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Obviously a typo in the help file, we can forgive that in such a good help file. :lmao:

No, I should have reitterated... I'm using beta .99 and wondering if the typo was fixed in the others.. not complaining on the help file by any means...

That is what the help file says. ;)

Ok SmartAss!! :king:

And actually the help files says:

The attributes that can be modified with the function are + or -:

which is left for interpretation o:) (although it should be as plain as black and white that way, it could still go left un-said on what it does.) I think this is your way of telling me to go to bed :lol:

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I'm using beta .99 and wondering if the typo was fixed in the others.. not

I'm using Beta .100 and it is still there as well.

Share this post


Link to post
Share on other sites

And actually the help files says: which is left for interpretation :lmao: (although it should be as plain as black and white that way, it could still go left un-said on what it does.) I think this is your way of telling me to go to bed ;)

Here is what the help file says higher up than you was reading

+-RASHNOT Attribute(s) to set/clear. e.g. "+A", "+RA-SH"

I hope your headache of earlier has eased. o:)


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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