Kok list? files collection object
 
Ini saya berikan contohnya
 
Public Sub FileListing()
Dim fso As New FileSystemObject, fl As Scripting.File
    For Each fl In fso.GetFolder("D:\").Files
        Debug.Print fl.Name
    Next
End Sub

tapi kamu juga harus perhatikan kemungkinan gagal penghapusan karena *.tmp
in use jadi mesti ada erro trapping.
 
 

  _____  

From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of matrixsoke waluyooke
Sent: Thursday, January 11, 2007 12:35 PM
To: [email protected]
Subject: RE: [Programmer-VB] Menghapus *.tmp



mengambil nama-nama file nya lewat list apa bisa ya...?

Gunawan <[EMAIL PROTECTED]> wrote: 


hapus per file dan baca dari files collection object

  _____  

From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of matrixsoke waluyooke
Sent: Thursday, January 11, 2007 11:00 AM
To: [email protected]
Subject: [Programmer-VB] Menghapus *.tmp


Kalau dalam DOS ada perintah DIR & DEL untuk VB perintah dir udah bisa cuma
untuk menghapus file-file sampah dari VB misalnya : Del *.tmp
saya dah utak atik dengan perintah dibawah ini belum jadi:
 
    dfol = "c:\windows\temp\*.tmp"
    Set fso = CreateObject("Scripting.FileSystemObject")
    If fso.FileExists(dfol) Then
       fso.DeleteFile dfol, True
        'MsgBox "Delete Sukses"
    Else
        MsgBox dfol & "File Tidak Ditemukan!", vbExclamation, "File Not
Exists"
    End If
 
apakah perintah dos bisa jalan di VB caranya gimana supaya bisa Del *.tmp
Terima Kasih
 
Send instant messages to your online friends http://uk.messenger.yahoo.com 


Send instant messages to your online friends http://uk.messenger.yahoo.com 

 

Kirim email ke