Home All Groups Group Topic Archive Search About
Author
20 Sep 2005 12:17 PM
Rick
Suppose I have a VB6 application running. I need by using code, self-destroy
the application, i.e. auto-delete the application file while running(may be
right after the END statement).

Any ideas?

Thanks.
--
Rick

Author
20 Sep 2005 12:50 PM
Ralph
"Rick" <R***@discussions.microsoft.com> wrote in message
news:220CB30C-607F-4CAB-A3B9-6FDE17ECF528@microsoft.com...
> Suppose I have a VB6 application running. I need by using code,
self-destroy
> the application, i.e. auto-delete the application file while running(may
be
> right after the END statement).
>
> Any ideas?
>
> Thanks.
> --
> Rick

There are several fundamental problems in any attempt to do this in Windows.
First, there are only two ways to destroy an application - you can ask it
politely, or you can kill it violently with possible drastic consequences
for the health of the system. Second, any attempt to delete an "open" file
is likely to fail, and fiddling with exe files is likely to raise the
interest of virus checking software.

Also you can't do anything after an End statement.

You will likely need to create a separate launcher or use a surrogate that
will call and run the exe then destroy it.

This sounds like a "nuisance" application. Perhaps, if you explained why you
feel you need to do this?

-ralph
Author
20 Sep 2005 1:17 PM
Bob Butler
"Rick" <R***@discussions.microsoft.com> wrote in message news:220CB30C-
607F-4CAB-A3B9-6FDE17ECF***@microsoft.com
> Suppose I have a VB6 application running. I need by using code, self-
> destroy the application, i.e. auto-delete the application file while
> running

Nope.  You'd have to start a second app (maybe even just a BAT file) that
delayed long enough for your app to shut down so that the EXE is no longer
in use and then delete it.

> (may be right after the END statement).

That's a trick question, right?  VB apps should not have an END statement...
it is never needed and can cause problems if used.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
20 Sep 2005 2:59 PM
Veign
Batch file idea:
http://www.veign.com/vrc_codeview.asp?type=app&id=114

There are better ways to do this without leaving any trace of the
application and without using a batch file but I just can't get myself to
make the code / ways public.....

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--


Show quoteHide quote
"Bob Butler" <tiredofit@nospam.com> wrote in message
news:uI1LtWevFHA.2212@TK2MSFTNGP15.phx.gbl...
> "Rick" <R***@discussions.microsoft.com> wrote in message news:220CB30C-
> 607F-4CAB-A3B9-6FDE17ECF***@microsoft.com
> > Suppose I have a VB6 application running. I need by using code, self-
> > destroy the application, i.e. auto-delete the application file while
> > running
>
> Nope.  You'd have to start a second app (maybe even just a BAT file) that
> delayed long enough for your app to shut down so that the EXE is no longer
> in use and then delete it.
>
> > (may be right after the END statement).
>
> That's a trick question, right?  VB apps should not have an END
statement...
> it is never needed and can cause problems if used.
>
> --
> Reply to the group so all can participate
> VB.Net: "Fool me once..."
>
Author
20 Sep 2005 3:11 PM
Dave
Ohhh, what a tease! (can't say I blame you though)

Show quoteHide quote
> There are better ways to do this without leaving any trace of the
> application and without using a batch file but I just can't get myself to
> make the code / ways public.....
Author
20 Sep 2005 6:42 PM
Rick
>This sounds like a "nuisance" application. Perhaps, if you explained why you
feel you need to do this?

It's no "nuisance" application, it should be an anti-crack application 
would destroy itself if certain conditions are not met.


--
Rick
Author
21 Sep 2005 7:44 AM
J French
On Tue, 20 Sep 2005 11:42:05 -0700, "=?Utf-8?B?Umljaw==?="
<R***@discussions.microsoft.com> wrote:

>>This sounds like a "nuisance" application. Perhaps, if you explained why you
>feel you need to do this?
>
>It's no "nuisance" application, it should be an anti-crack application 
>would destroy itself if certain conditions are not met.

Make the App write a little batch file

It can loop round trying to delete the file while the file exists
Author
22 Sep 2005 12:13 AM
Michael Cole
Rick wrote:
>> This sounds like a "nuisance" application. Perhaps, if you explained
>> why you feel you need to do this?
>
> It's no "nuisance" application, it should be an anti-crack application
> would destroy itself if certain conditions are not met.

Some thoughts: -
The idea that you have is not perfect - firstly you need to ensure that this
will not occur by accident - it could annoy your legit users.  Secondly, if
they are serious crackers, then this wont be a problem for them.  They will
simply make a copy of the exe first, or even just Delete-protect it.

Basically, if you want to crack protect the application, you will need to be
a lot more sneaky.


--
Regards,

Michael Cole