HOW DO I DELETE A BMP FILE IN MY HARD DRIVE.

Hi,

I would like to delete a specific bmp file on a specific directory. how do I do that? Thanks.
neonlightsAsked:
Who is Participating?
 
sgayatriConnect With a Mentor Commented:
Add project >> references >> microsoft scripting runtime to yur project

dim fso as new scripting.filesystemobject
 str1="yourfilewithpath"

if fso.fileexists(str1) then   ''check if ur file exists
   fso.deletefile(str1)
end if
0
 
fds_fatboyCommented:
kill (pathname)
0
 
Erick37Connect With a Mentor Commented:
On Error Resume Next  ' or GoTo ...
Kill "c:\thepath\thebmp.bmp"
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
fds_fatboyConnect With a Mentor Commented:
sorry - try again

kill pathname
0
 
EDDYKTConnect With a Mentor Commented:
You may get an error if file is readonly


SetAttr pathname, GetAttr(pathname) And Not vbReadOnly
Kill pathname
0
 
TeddyZeroConnect With a Mentor Commented:
Try this

Sub DeleteAFile(ByVal filespec As String)
   Dim fso As Object
   Set fso = CreateObject("Scripting.FileSystemObject")
   fso.DeleteFile(filespec)
End Sub


I Hope this helps you...
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.