Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can a read-only file be deleted?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00600258
Message ID:
00600264
Views:
22
>I need to delete a directory that has 2 read-only files in it.
>
>DELETE FILE and ERASE will not remove read-only files. I can not seem to find a way to change the attributes of a file, so then I could delete the files.
>
>I know the RD command will delete the directory once I remove the files.
>I hope I am missing something simple. Any help would be appreciated.
>
>
Steve,

If the WSH is an option, I'd use the Scripting.FileSystemObject in this sort of case
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
* Delete files matching the skeleton
* even if the read-only bit is set
oFSO.DeleteFile(lcfilespec, .T.)
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform