Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to uncheck the windows attribute readonly
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00870776
Message ID:
00870813
Views:
8
>I use this to make it readonly using WSH:
>
>IF FILE("C:\scanned2903.tif") THEN
> oFSO = CREATEOBJECT("Scripting.FileSystemObject")
> oFile = oFSO.GetFile("C:\scanned2903.tif")
> * Set the read-only bit.
> oFile.Attributes = BITOR(oFile.Attributes, 1)
>ENDIF
>######################################
>I use BITOR to make it read only.
>I don't know how to reverse the BITOR.
>
>Thank you..

As Hilmar said, BitXOR will toogle the attribute. You can use
oFile.Attributes = oFile.Attributes - BitAnd(oFile.Attributes, 1)
to unset it regardless of its state
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform