Results 1 to 7 of 7

Thread: need some help, can you...?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Location
    Posts
    30
    I am making a program for my friend but i dont want him to be able to distribute it, so i wanted to make it so when the program was done running it would delete itself, would i just use the command

    Kill Self
    ?

    That seems a little to easy...
    Please help.. thanks!
    Dreys
    "Your worst enemy is your greatest teacher."

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    use a batch file that delete your program and then delete itself.

    Batch file can delete themself.

  3. #3
    Guest
    Something like this:

    Code:
    Open App.Path & "\tempdel.bat" For Output As #1
    'Print #1, "@ECHO OFF" 'Turn this on if you want the user to see what your doing
    Print #1, "IF EXIST " & """" & App.Path & "\myprog.exe" & """" & " DEL " & """" & App.Path & "\myprog.exe" & """"
    Print #1, "Del """ & App.Path & "\tempdel.bat"""
    Close #1
    Than just Unload your program and Shell the bat file and the bat file will delete your program and then delete itself.

  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    How would you unload the program then call the batch file?

    I would advise including the "@echo off" bit, that way they don't get to see what's happening and interrupt it. Not like they'd be fast enough anyway though
    Harry.

    "From one thing, know ten thousand things."

  5. #5
    Guest
    Call it in the Unload Event.

    Code:
    'Private Sub Form_Unload(Cancel...)
    Shell "Mybat.bat"
    Unload Me
    End
    'End Sub

  6. #6
    Member
    Join Date
    Dec 2000
    Location
    Dorado, Puerto Rico
    Posts
    36

    Thumbs up

    Hello;

    The sugestion of a bat file is very good. But if he makes a copy of the installation disk before he istall it. This will let him install the software in another machine.

    Try this:

    1. Make the program look for a key file. Make a file that will be used by the system to verify that he is a valid copy.
    Example

    if dir("your_file")="" then
    msgbox "This is a not valid copy"
    end
    end if

    2. Create the key file by your self. Try making the file to be difucult to detect.

    If he tries to install the program in another machine it will not work because the key file will not exist in that machine.

    adcomp - Puerto Rico

    [Edited by adcomp on 12-06-2000 at 07:39 AM]
    adcomp - Puerto Rico
    God bless you all/Dios me los bendiga a todos

  7. #7
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    i would put it in the Terminate event,
    cuz it's after the Unload event,if you try to delete
    in the Unload event, it won't work cuz your program
    still running!!

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