Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to uncheck the windows attribute readonly
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00870776
Message ID:
00870813
Vues:
9
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform