Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automatic file deletion
Message
 
À
16/08/2000 03:19:08
Victor Lapid
Phil. Long Distance Tel. Co.
Manila, Philippines
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00405368
Message ID:
00405428
Vues:
12
>Hi,
>
> I'm trying to delete files with wilcards chars (eg. "vb*.tmp")
>using FileExists (Filesystemobject class) unfortunately, it doesn't work with wilcards chars.
> Any idea.
>
> TIA.

Use Kill to delete files using wildcards.

Took from the VB help:
Kill Statement
      

Deletes files from a disk.

Syntax

Kill pathname

The required pathname argument is a string expression that specifies one or more file names to be deleted. The pathname may include the directory or folder, and the drive.

Remarks

In Microsoft Windows, Kill supports the use of multiple-character (*) and single-character (?) wildcards to specify multiple files


Kill Statement Example
This example uses the Kill statement to delete a file from a disk.

' Assume TESTFILE is a file containing some data.
Kill "TestFile"   ' Delete file.

' Delete all *.TXT files in current directory.
Kill "*.TXT"   
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform