Results 1 to 4 of 4

Thread: Program; self deletion

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2003
    Posts
    206

    Question Program; self deletion

    yuyuyuyu
    Last edited by Aphex; Apr 17th, 2009 at 08:54 PM.

  2. #2
    Fanatic Member ZeBula8's Avatar
    Join Date
    Oct 2002
    Posts
    548
    have your program construct a batch file that is then called to delete your program -

    you can have a registry key in the RunOnce that points to the path of this batch file and when the pc is rebooted your program will be deleted....

    i also used this for an update program - but i didn't delete my program with it - only highly secretive temp files i didn't want to be left lying around

  3. #3
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    create a batch file using something like

    VB Code:
    1. Private Function APPPATH() As String
    2.    
    3.     If Right$(App.Path, 1) <> "\" Then
    4.         APPPATH = App.Path & "\"
    5.      Else
    6.         APPPATH = App.Path
    7.     End If
    8.  
    9. End Function
    10.  
    11. Private Sub Command1_Click()
    12.  
    13.     Open APPPATH & "batch.bat" For Output As #1
    14.     Print #1, "del "; Chr$(34) & APPPATH & App.EXEName & ".exe" & Chr$(34)
    15.     Close #1
    16.     Shell APPPATH & "batch.bat"
    17.     Unload Me
    18.    
    19.  
    20. End Sub

  4. #4
    Fanatic Member ZeBula8's Avatar
    Join Date
    Oct 2002
    Posts
    548
    probably best to switch those last 2 lines around like this:

    Code:
    Unload Me
    Shell APPPATH & "batch.bat"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width