Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read Only
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00689759
Message ID:
00689784
Vues:
24
>Hi All:
> How can I tell programically if the file status is ReadOnly? If it is, how can I change the status to not ReadOnly programically in Win2000?
>Thanks
>MA

You can also use WSH
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFile = oFSO.GetFile(lcfile) && lcfile is the name of the file
IF BITAND(oFile.Attributes, 0x01) = 1   && Is file read only
   oFile.Attributes = BITAND(oFile.Attributes, 0xFE)   && Turn off read only attriburte
ENDIF
Remember that WSH is included in Windows starting with Windows 2000. There's no guaranty that it would be present on PC with any previuos version of Windows.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform