 |
 |

03-02-2004, 07:35 AM
|
|
Centurion
|
|
Join Date: Jan 2004
Location: Malaysia, KL
Posts: 136
|
|
delete the contents inside a folder
|
is it possible to delete the contents inside a folder using VB ??
for example, i got one folder used to stored image and and i wish to delete all image inside the folder using cmdDelete.
is it possible ?
|
__________________
- hopefully one day i'll become programming expert like you guys -
|

03-02-2004, 07:38 AM
|
|
Centurion
|
|
Join Date: May 2002
Location: The Netherlands
Posts: 145
|
|
Quote: Originally Posted by ncks82 is it possible to delete the contents inside a folder using VB ??
for example, i got one folder used to stored image and and i wish to delete all image inside the folder using cmdDelete.
is it possible ?
Remove Files in folder:
Code:
Kill "C:\MyFolder\*.*" 'Or *.extension
Remove Folder:
Code:
RmDir "C:\MyFolder\"
|
|

03-02-2004, 07:40 AM
|
|
Regular
|
|
Join Date: Feb 2004
Location: Slovakia
Posts: 51
|
|
|
Of course, and its like this:
Kill ("your path\*.jpeg")
Greetings,
Metaller
|
|

03-02-2004, 08:07 AM
|
|
Centurion
|
|
Join Date: Jan 2004
Location: Malaysia, KL
Posts: 136
|
|
|
AH !!
yes, just remember !!!
anyway, thanks for the replies.~
thank you/
Kill statement.
This is the question which i wanna ask from last time..
once i performed kill statement, the file is permanently deleted ???
if yes, how can i just remove it to recycle bin ?
|
__________________
- hopefully one day i'll become programming expert like you guys -
|

03-02-2004, 09:05 AM
|
|
Regular
|
|
Join Date: Feb 2004
Location: Slovakia
Posts: 51
|
|
|
Yes, the file is absolutely lost...
But how to do deleting to recycle bin, i dont know...
There is no help in MSDN for that question...
Browse more sites, hope you'll find the answer...
Metaller
|
|

03-02-2004, 09:43 AM
|
|
Centurion
|
|
Join Date: Jan 2004
Location: Malaysia, KL
Posts: 136
|
|
Quote: Originally Posted by metaller Yes, the file is absolutely lost...
But how to do deleting to recycle bin, i dont know...
There is no help in MSDN for that question...
Browse more sites, hope you'll find the answer...
Metaller
thank you
here is my problem
i got a list box and i just want to delete the file in the folder where selected from the listbox.
this code cant work because when i click the delete button, nothing happen. what's wrong with this code ?
please correct me.
Code:
Private Sub cmdDelete_Click()
Dim fileName As String
Dim x As Integer
Dim tempFile As String
tempFile = App.Path & "\image\.BMP"
For x = 0 To lstView.ListCount - 1
fileName = lstView.List(x)
pathName = App.Path & "\image\" & fileName & ".BMP"
If pathName = tempFile Then
Kill tempFile
End If
Next x
End Sub
|
__________________
- hopefully one day i'll become programming expert like you guys -
|

03-28-2004, 05:31 AM
|
 |
Contributor
|
|
Join Date: May 2003
Location: Dublin
Posts: 502
|
|
|
Private Sub cmdDelete_Click()
Dim fileName As String
Dim x As Integer
Dim tempFile As String
tempFile = App.Path & "\image\.BMP"
For x = 0 To lstView.ListCount - 1
fileName = lstView.List(x)
if ucase(right(filename,3))="BMP" then Kill tempFile
Next x
End Sub
Try this
JamesAnthony
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|