Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File Attributes, Modifying with VFP
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00703931
Message ID:
00703934
Views:
20
>Is there a way to modify file attributes (maybe something similar to using the DOS ATTRIB command) within VFP code? Would appreciate any help. TIA

You can use WSH
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFile = oFSO.GetFile(lcfile) && lcfile is the name of the file
* Turn on the read-only bit
oFile.Attributes = BITOR(oFile.Attributes, 0x01)
* Turn off the read-only bit
oFile.Attributes = BITAND(oFile.Attributes, 0xFE)
You can also use File Attribute Get & Set File #9311 or SetFileAttributes API #12727.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform