Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command in FoxPro Similar to attrib in dos ?
Message
From
24/10/2000 16:08:43
 
 
To
24/10/2000 16:06:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00433751
Message ID:
00433755
Views:
16
>>Does FoxPro have a command that will allow changing of the attributes on a file ? Or can I delete a read only file in FoxPro. The files I need to delete are BMP picture files.
>>
>>Thanks
>
>RUN attrib *.bmp -r
>ERASE *.bmp

>
>or use the FileSystemObject
>
oFSO = CreateObject("Scripting.FileSystemObject")
>oFolder = oFSO.GetFolder("c:\mypath\bmps")
>FOR EACH oFile IN oFolder
>  IF UPPER(JUSTEXT(oFile.Name))="BMP"
>    oFile.Delete(.T.) && force deletion, whether read-only or not
>  ENDIF
>ENDFOR
>
>Of course, any of this code should be modified to delete only the desired BMP files :)

Or use the Windows API SetFileAttributes() function.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform