Automated Delete File

Oldsoftboss

AWF VIP
Local time
Tomorrow, 04:37
Joined
Oct 28, 2001
Messages
2,499
I have a piece of code:
If fIsFileDIR("c:\Program Files\My Documents\TextFile.txt") = -1 Then
'Da da da

Exit Function

This code is used in an expiry date function and checks whether a file exists on the HD (Another function creates it if it doesn't)

What I'd like to do:

Use the above code after the product has been registered to delete it like

If Me.Registered =True then 'a hidden check box
If fIsFileDIR("c:\Program Files\My Documents\TextFile.txt") = -1 Then
Delete it.

I would like to delete this file because a re-install of the original software (now unregistered until they re-enter the code)
looks for this file before creating an expiry date and says "Hmm funny stuff going on here, Sorry Quit."

The file will always be in the same place, just need code to delete it.

Thanks
Dave
 
Solved my own problem by using the kill statement

Kill "c:\Program Files\My Documents\TextFile.txt"

Dave
 

Users who are viewing this thread

Back
Top Bottom