how to make self destructive exe's

how to make an exe file using C program so that
it destroys itself after 10 days . i mean a trial version

Comments

  • : how to make an exe file using C program so that
    : it destroys itself after 10 days . i mean a trial version
    :

    Ask kunthavai or renuga. I think they will give the right ans


  • : how to make an exe file using C program so that
    : it destroys itself after 10 days . i mean a trial version
    :
    A simple way is to use findfirst() to get the ffblk structure (which contains the file's date), then use ftime to get the current time, compare the two, and if current time is more than 10 days later than the file's time, use remove() to delete the file. This is unreliable however, because someone can always modify the file's time using touch or some other method. The argument for findfirst() can be gotten from argv[0].

  • : : how to make an exe file using C program so that
    : : it destroys itself after 10 days . i mean a trial version
    : :
    : A simple way is to use findfirst() to get the ffblk structure (which contains the file's date), then use ftime to get the current time, compare the two, and if current time is more than 10 days later than the file's time, use remove() to delete the file. This is unreliable however, because someone can always modify the file's time using touch or some other method. The argument for findfirst() can be gotten from argv[0].
    :
    :
    This, probably, will not work in Windows - you can't delete an EXE file which is running.

  • : : : how to make an exe file using C program so that
    : : : it destroys itself after 10 days . i mean a trial version
    : : :
    : : A simple way is to use findfirst() to get the ffblk structure (which contains the file's date), then use ftime to get the current time, compare the two, and if current time is more than 10 days later than the file's time, use remove() to delete the file. This is unreliable however, because someone can always modify the file's time using touch or some other method. The argument for findfirst() can be gotten from argv[0].
    : :
    : :
    : This, probably, will not work in Windows - you can't delete an EXE file which is running.
    :
    :

    Could program create visual basic script that is stored in startup folder which on next boot would delete file?

  • : Could program create visual basic script that is stored in startup folder which on next boot would delete file?
    :
    I've think about it.
    Try that: write a prog like delete.exe, which erase Your program from disk. Then, put a registry key in HKLM/Software/Microsoft/Windows/Current Version/RunOnce with value ="Path to delete.exe (e.g. c:/Yourprogs/delete.exe)"
    It will run once after rebooting and will erase Your trial version.
    I'hope, You understand me. My English is not very
  • : This, probably, will not work in Windows - you can't delete an EXE file which is running.
    :
    :
    This works just fine on Windows 98. Don't know about NT or 2000 since I don't have access to those (and I wouldn't use XP if you paid me).

    #include
    #include

      #include

      int main(int argc, char *argv[])
      {
      int i;
      struct ffblk finfo;

      printf("
      file name: %s
      ", argv[0]);
      i = findfirst(argv[0], &finfo, 0);
      if (!i)
      {
      i = remove(argv[0]);
      if (!i)
      printf("file removed
      ");
      else
      printf("
      Can't remove file %s
      ", argv[0]);
      }
      else
      printf("
      Can't find file %s
      ", argv[0]);

      return(0);
      }


  • Hi Guy ! I don't know 'bout the other compilers ,but I feel that This kinda Thing can be done in C .You first get the name of the program itself by command line arguments . use void main(int argc ,char **argv) instead of void main() argv[0] is the name of the program itself .Then after execution , you can use unlink() or remove() etc.. to delete the file you want .... !
    Karthik Kumar V

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories