Is there any way for an application to wait for a period of time and then kill a file?
If you do not want to block application execution, use Timer control:
Timer1.Interval = 10000 Timer1.Start() Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick My.Computer.FileSystem.DeleteFile("<file to delete>") End Sub
If you can block your application execution:
Threading.Thread.Sleep(10000) My.Computer.FileSystem.DeleteFile("<file to delete>")
In both cases the delay is 10 seconds (10 000 milliseconds).