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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
All Courses

From novice to tech pro — start learning today.