help how to Remove [ i'm back :p]

Posts 1–15 of 22 · Page 1 of 2
help how to Remove [ i'm back :p]
hello mPgH ...[ all] [ I'm back with more Questions ]...
okay ..
how i can make the program when Exit Remove self ??
?? help
and thank you
of you don't understand just say please don't spam /yea/yea

Edit : added ..[ I'm back with more Questions ]...
try it on form close event...

io.file.delete or something like that...
my.computer.filesystem.delete...

If that does not work, you cannot do it since you cannot delete your program while you are accesssing it.
[php]Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
My.Computer.FileSystem.DeleteFile(processdir & "nametheprogram", FileIO.UIOption.OnlyErrorDialogs)
End Sub[/php]
??
I'm not sure you can because you are running it while trying to delete it.
Code:
Imports System.IO
Public Class Form1

    Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Dim start As String = Application.StartupPath
        Dim name As String = "Program Name.exe"

        File.Delete(Path.Combine(start, name))
    End Sub

End Class

Quote Originally Posted by Shark23 View Post
I'm not sure you can because you are running it while trying to delete it.
QFT. Try it though.
Quote Originally Posted by Blubb1337 View Post
Code:
Imports System.IO
Public Class Form1

    Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Dim start As String = Application.StartupPath
        Dim name As String = "Program Name.exe"

        File.Delete(Path.Combine(start, name))
    End Sub

End Class
I do not want name specific...
Whatever name i wanna to delete
^Can you state that more clearly?


As an example, I would liken this to trying to delete your C: drive. You can't because you are running on it.
Quote Originally Posted by Shark23 View Post
^Can you state that more clearly?


As an example, I would liken this to trying to delete your C: drive. You can't because you are running on it.
this Program..
and you can Remove it when Exit...
look Exit ... Understand it NO use
When exiting you are STILL using it. But try my code above to see if it works at all.
Quote Originally Posted by Blubb1337 View Post
When exiting you are STILL using it. But try my code above to see if it works at all.
hey what about the name No help ??
Quote Originally Posted by Blubb1337 View Post
When exiting you are STILL using it. But try my code above to see if it works at all.
Enter your current name to see IF IT IS WORKING AT ALL.
You can't change anything about an application that's running pretty much, I.E you can't delete it.

That means there's no way to use a program to delete itself. For it's code to be active, the application has to be open, meaning you can't delete it.
Save a .bat on form closing.
Start the bat(obviously).

Let the .bat sleep for a second and afterwards delete it.

Idk any other solution ^^
He has really bad grammar, and it's pretty much impossible. You can't delete an application you're using. And even on exit, it's still using the codes from the program. No durr. /Request close thread.
Posts 1–15 of 22 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?