|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
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 "Rick" <R***@discussions.microsoft.com> wrote in message There are several fundamental problems in any attempt to do this in Windows.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 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 "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- Nope. You'd have to start a second app (maybe even just a BAT file) that> destroy the application, i.e. auto-delete the application file while > running 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..." 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..... -- Show quoteHide quoteChris Hanscom - Microsoft MVP (VB) Veign's Resource Center http://www.veign.com/vrc_main.asp Veign's Blog http://www.veign.com/blog -- "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..." > 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..... >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 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 Make the App write a little batch file>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. It can loop round trying to delete the file while the file exists Rick wrote:
>> This sounds like a "nuisance" application. Perhaps, if you explained Some thoughts: ->> 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. 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
VB6 : Attach Event Handlers to Dynamically Generated Controls
Newbie: FOR loop on dates Declaring a Constant List all jpg files from folder (loop problem) Random first random number Do The Runtime DLLs Come With Win2000? Question on printing with Snapshot from VB 6 XMLdoc for VB VB6 IDE VBE Object reference dbGrid96.hlp |
|||||||||||||||||||||||