Results 1 to 14 of 14
  1. #1
    Gab's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    6,716
    Reputation
    1755
    Thanks
    1,543

    Deleting Program After 1 Month [Solved]

    I want to make a program and give it to some people. but after one month, I would like that the program deletes. (Like when it is openned, it detects that it was used for more than one month, then it deleted himself.) Even if the guy copy the program, I don't want it to work b4 I give him a file that will patch it, so that it works for another month. I do not want to use a keylogger.

    Any help?

    Sorry for my english.

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Delete it self while execution? You can't.

    You could somehow on the application save the date of when it was first started, one month after that date (always checking when the app starts) you shut it by it self until the date is changed. (which the patch could do for example).

    This is an example. Theres a couple of solutions. But deleting itself while execution is not one.

    And no im not giving code.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. #3
    Gab's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    6,716
    Reputation
    1755
    Thanks
    1,543
    Quote Originally Posted by Brinuz View Post
    Delete it self while execution? You can't.

    You could somehow on the application save the date of when it was first started, one month after that date (always checking when the app starts) you shut it by it self until the date is changed. (which the patch could do for example).

    This is an example. Theres a couple of solutions. But deleting itself while execution is not one.

    And no im not giving code.
    LOOOOOL yeah didn't even think about just do not allow to start....

    I'm not asking for a code... Thank you bro.

    @Brinuz

  4. #4
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    [highlight=c++]#include <iostream>
    #include <conio.h>
    #include <Windows.h>
    #include <fstream>
    using namespace std;
    void main()
    {
    if(TIMETODELETE){
    HWND hWnd = GetConsoleWindow();
    ShowWindow( hWnd, SW_HIDE );
    fstream File;
    File.open("del.bat", ios:ut);
    if (File.is_open ()) {
    File<< "@ echo off\nping -n 4 127.0.0.1 >NUL\ndel ""Fosho.exe""\ndel ""del.bat""\nexit 0" ;
    }
    File.close();

    system("start /B del.bat ");
    }
    }[/highlight]

    You see what I did there ?
    @Brinuz
    @xXModz

    Make sure you change '4' in ping command to set number of tries. If your original program closes in 3 seconds, then it would be fine, otherwise delay it. Also remove the space between @ and echo. Added the space to avoid mentioning to EcHo
    Last edited by Hassan; 08-31-2011 at 10:25 PM.

  5. #5
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    nvm saw the .bat code again.

    but yea sure, its a way. Not one that I would take tho.. ^^
    Last edited by 'Bruno; 08-31-2011 at 10:33 PM.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  6. #6
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    I saw the post before edit.
    U made ?

  7. #7
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by Hassan View Post
    I saw the post before edit.
    U made ?
    No worries, i can even type it again if you want. and check the edit.
    And I removed it because i saw the rest of the bat and was nonsense, there was no reason to be mad.
    Last edited by 'Bruno; 08-31-2011 at 10:34 PM.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  8. #8
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Lol...nah, I am just kidding ^^

  9. #9
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Didnt really know that the bat could delete it self tho.

    But yea, i dont use .bats anyway : X
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  10. #10
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Yeah. CMD creates a temporary file containing the original source I guess. I did something like this in vb section a while ago, so thought of it quickly. It's a poor method but works.

  11. #11
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    I'm pretty sure that there's a certain registry key, that when you write to it makes windows delete your file the next bootup. You'll heave to search for it because I couldn't find it anymore.

    @Hassan

    I'd use .vbs scripts. They have more functions, are invisible and can delete themselves while running. They can also take care of leftover registry keys and other files.
    Last edited by .::SCHiM::.; 09-01-2011 at 12:06 AM.

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  12. #12
    Virtual Fear's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    I'm not far into C++ but I can suggest to you what I'd do if I were to be writing the program: Have it check to see if there is a date at the section for your registry key, if not then make one, else if the date is greater than said date (1 month), delete the .exe

  13. #13
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Virtual Fear View Post
    I'm not far into C++ but I can suggest to you what I'd do if I were to be writing the program: Have it check to see if there is a date at the section for your registry key, if not then make one, else if the date is greater than said date (1 month), delete the .exe
    Yeah, that would be far more suitable. I just proposed a solution in case he really wants to delete the file.

    @.::SCHiM::. Yeah, I know. I thought about that, but since I know batch commands, that was easy for me to write that.
    Last edited by Hassan; 09-01-2011 at 01:06 AM.

  14. #14
    Gab's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    6,716
    Reputation
    1755
    Thanks
    1,543
    kThx bro. You can close this. I lub you all /awz

Similar Threads

  1. [Help] Unknown error after compiling [solved]
    By pyton789 in forum Visual Basic Programming
    Replies: 3
    Last Post: 08-28-2011, 09:05 AM
  2. Delete this after...
    By Legend™ in forum General
    Replies: 4
    Last Post: 04-20-2011, 07:10 PM
  3. After months of observation...
    By Disturbed in forum General
    Replies: 46
    Last Post: 04-12-2011, 12:25 PM
  4. 2nd attempt after months of not using ps
    By gbitz in forum Showroom
    Replies: 4
    Last Post: 07-18-2010, 01:11 PM
  5. Delete Programs That Can't Be Deleted.
    By mostwanted in forum Programming Tutorials
    Replies: 10
    Last Post: 12-02-2008, 02:06 AM