Link to home
Start Free TrialLog in
Avatar of laveshverma
laveshvermaFlag for India

asked on

Deleting a image using Vb6.0

Hello Sir,
I want to delete the images, which are in .bmp format using Visual Basic 6.0.
how is it be done??
I have used the command like:
1.  Kill App.Path & "av.bmp"
2.  Kill "D:\tpf\av.bmp"
But both of these are not working and the error is showing like " File not found".While I have a picture on the path "D:\tpf \" with name "av.bmp"
Please Guide me how to solve this problem?
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

See if another VB method such as Dir$() can find it.

If Dir$("D:\tpf\av.bmp") = "" then
     Msgbox "File not found"
Else
      Kill "D:\tpf\av.bmp"
      MsgBox "File deleted"
end if
If you're getting a "File not found" error it must be something to do with path issues. Maybe you have some misspelling in your path or file description, or maybe your D unit is mapped into your computer in a way that application cannot resolve.

If D: is pointing to a remote unit you must use the network address \\domainServer\pathToFile\file
ASKER CERTIFIED SOLUTION
Avatar of Leithauser
Leithauser

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of laveshverma

ASKER

Thank you Sir, Now the command working completely well...:)