0

hi Sirs,
i m using vb6 and acess2000, crystal report 9.
i want to delete *.tmp files created due to crystal report 9.
i want this in vb6 through coding.
pls help me.
these files are created on partition and of 0 bytes.
so, pls help me its urgent.
thanx in advance

5
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by vponline
0

This is from VBHelp. If you use an error handler, I would suggest that you disable it, as in the example, because Kill can generate non-fatal errors. For instance, the file the example tries to delete doesn't exist.

Public Sub ErrDemoSub()
On Error GoTo SubHandler ' Error trapping is
' enabled.
' Errors need to be caught and corrected here.
' The Kill function is used to delete a file.
Kill "Oldfile.xyz"
On Error GoTo 0 ' Error trapping is turned off
' here.
Kill "Oldfile.xyz"
On Error GoTo SubHandler ' Error trapping is
' enabled again.
Kill "Oldfile.xyz"
Exit Sub
SubHandler: ' Error-handling routine goes here.
MsgBox "Caught error."
Resume Next
End Sub

If you aren't worried about error messages, just use:
Kill "C:\[path]\*.tmp"

0

Dear Sir,
Thanks for reply.
pls tell me how do i write code in vb to delete these *.tmp files?
pls give me code snippet.
so that i will solve it immediately.
thnaks for reply once again
shruti

0

Hi Shruti,

rstkw has already answered you:

Write this Code:

Kill "C:\MyFolder\*.tmp"

Change MyFolder, to whatever folder you want.. Anyway, whenever, you Kill files, you need to be carefull..

Regards
Veena

0

Exactly was i was going to say to use
Kill "C:\[path]\*.tmp"
if its only a temp file,it should be used,i use the same thing in my software when i wrote "preview" code for some software i released
matt's java flexbars (scrollbar coder for IE5 and up) created in vb and produces java script to be added to your website that fluctuates the scrollbars colors

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.