Delete Timer ?

Posts 1–13 of 13 · Page 1 of 1
Delete Timer ?
Is there a way you can make it so a file " Delete's itself" On a certain date,
or time, After it is used?


Just a question Im a newbie in VB6 . :3

Anyways Leave a comment Below

-N3XON
If systemdate = day then
Delete file
end if

Ofcourse that code wont work like that, but the concept is correct
Quote Originally Posted by Erinador View Post
If systemdate = day then
Delete file
end if

Ofcourse that code wont work like that, but the concept is correct
............. Ha ........... Ha ...

points to public stupidity section of my signature



Solution:

Code:
' put this in between your time 
' or to be more creative, Create a Label on the form , set the label value to 'the system data add a timer, have timer check label1.text for date and if 'date is = to a specific date then run below.  

Dim FileToDelete As String

FileToDelete = "File you are looking to delete"

If System.IO.File.Exists(FileToDelete) = True Then

System.IO.File.Delete(FileToDelete)
MsgBox("File Deleted")

End If
Thank's Il try that right now!
Quote Originally Posted by NextGen1 View Post
............. Ha ........... Ha ...

points to public stupidity section of my signature



Solution:

Code:
' put this in between your time 
' or to be more creative, Create a Label on the form , set the label value to 'the system data add a timer, have timer check label1.text for date and if 'date is = to a specific date then run below.  

Dim FileToDelete As String

FileToDelete = "File you are looking to delete"

If System.IO.File.Exists(FileToDelete) = True Then

System.IO.File.Delete(FileToDelete)
MsgBox("File Deleted")

End If
Your the stupid one.
1. He needs to import System.IO
2. FileToDelete must be a path, not a file name. For example, if you just put "Readme.txt", how would VB know where Readme.txt?
No problem, and it will work
um just saying isnt it technically >Impossible< for a file to delete itself, because if it is being used at that time it cannot delete a file that is in use and for the timer to be going the application must be in use, therefor you cannot have a file delete itself
O-O , I should read posts more carefully,

I assumed that he was asking how to delete "a" file, like a .dll or something else.

yes it is impossible to delete a running process at a certain time.

What I would do

Create another project, Call it something along the lines of tstamp., Have it run on windows start up,
to constantly check date. use that app to do what is mentioned in my code above.

Running it as a process prevents a user from deleting this file (if you are using it as a way to control a trial, though there is a much better way of doing that)
Google for melting executable, I guess you'd find C/++ code, but it shouldn't be that hard to make a VB version of it
Quick question, I'm going to do some testing, I remember a while ago hearing system 32 had a self delete API, this may work if I can do some tests and see if i can get a working code for you.

(just verify Hell_demon if you know)
Bind a dummy program to it. So the dummy deletes the main with it also.
I already said that, only issue with that is the other file will be left behind...

So best bet is Batch and move .bat to temp files , force reboot,

More complex way will be System 32 Selfdelete API which is a copy , move , delete , temp result, or Hell_demon's melt method
WTF are you talking about...?!

Before you call someone stupid, Use Google

Dim FileToDelete As String

FileToDelete = "File you are looking to delete"

If System.IO.File.Exists(FileToDelete) = True Then

System.IO.File.Delete(FileToDelete)
MsgBox("File Deleted")

End If
In the quotes inside the quotes,when I say file to delete I mean file path + file..... as anyone (but you) would assume (as long as they understand VB) I never said file name, File to delete can be C:\STFU\GTFO\Suckoff.txt .... or using the in file location App.path.

On top of that , You don't need to import system.IO to delete a file,
go read the idiots guide to vb.net or something, or is it holding up your monitor?

Further more , He doesn't need to delete a single random file, he needs to melt or self delete a running process.

If you want me to write a code and upload it, I will, Hey I want you to learn too.

but you seem to know it all

GTFO

Posts 1–13 of 13 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us