Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Command in FoxPro Similar to attrib in dos ?
Message
De
24/10/2000 16:08:43
 
 
À
24/10/2000 16:06:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00433751
Message ID:
00433755
Vues:
18
>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform