Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automatic file deletion
Message
 
À
16/08/2000 08:41:02
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:
00405818
Vues:
17
>Igor,
>
>
> Sorry , I'd rather re-phrase my question, how to check existence of those files eg. vb*.tmp then perform automatic deletion ->(Kill app.path "\vb*.tmp")

Hi Victor,

Take a look at the code. Is this what you want?
    Dim objFSO As New FileSystemObject
    Dim objFolder As Folder
    Dim objFile As File
    Dim strPath as String

    strPath = "C:\Temp"
    Set objFolder = objFSO.GetFolder(strPath)
    
    For Each objFile In objFolder.Files
        If Right(objFile.ShortName, 3) = "TMP" Then
            ' Your code goes here ....
            ' Let's delete the file
            objFile.Delete
        End If
    Next

    Set objFSO = nothing
    Set objFolder = nothing
    Set objFile = nothing
HTH, Igor
Igor Gelin
Database Developer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform