Jump to content

Set Folder Attribute


 Share

Recommended Posts

  • Developers

Hello,

How can i set a Folder to Read Only?

It's there only a function for files?!

FileSetAttrib ( "file pattern", "+-RASHNOT" [, recurse] )

Thanks,

John.

<{POST_SNAPBACK}>

Work also for Directories.... Just try it... :whistle:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I've done this:

FileSetAttrib ( "C:\Documents and Settings\MRX\Bureaublad\test", "-R",1 )

When i'm opening the Property window of this folder, the option of Read Only is checked.

It should be unchecked..

<{POST_SNAPBACK}>

I have tried this as well and all folders under XP showup as Read 0nly marked by a green box. I also tried it on files and it sets/unsets the properties as required. In XP if you remove the read only then apply you will find that they change back automatically the next time you look at it.


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

  • Developers

I've done this:

FileSetAttrib ( "C:\Documents and Settings\MRX\Bureaublad\test", "-R",1 )

When i'm opening the Property window of this folder, the option of Read Only is checked.

It should be unchecked..

<{POST_SNAPBACK}>

Works fine for me on WinXP Pro SP2...

Just tested it on a folder on the desktop like you are doing:

FileSetAttrib("C:\Documents and Settings\vanderzanjp\Desktop\test","+R",1)
Sleep(5000)
FileSetAttrib("C:\Documents and Settings\vanderzanjp\Desktop\test","-R",1)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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