Jump to content

Setting File Attributes for Entire Drive


Endgame
 Share

Recommended Posts

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)


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

Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
Share on other sites

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

Why not ? The help file indicates that it should.


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

Link to comment
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.

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
Link to comment
Share on other sites

  • Moderators

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?

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.

Link to comment
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. ;)


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

Link to comment
Share on other sites

  • Moderators

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:

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.

Link to comment
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:)


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

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...