Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read Only
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Miscellaneous
Thread ID:
00689759
Message ID:
00689784
Views:
25
>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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform