CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 1999
    Posts
    4

    how to delete running file

    Hi,

    I am developing simple setup/uninstall program for my own needs. The question is: when my uninstaller runs how can I delete the uninstaller iself?


  2. #2
    Join Date
    Apr 1999
    Posts
    306

    Re: how to delete running file

    As far as understand of MS Windows no one can delete a running program. Otherwise we all shall be overriding functions like this:
    OnPervertDeletingYourRunningProgram(MSG* pMsg)
    {
    AfxMessageBox("Please, pervert, do not kill my program, it is still running!");
    }

    But why dont you try this, create another process with a different context, stack, heap, no parent and what ever else you can think of, then close your app and delete it from the process. Once I have a similar problem in a program, but luckly the program was discarded before to be implemented and I never has the chance to try this. So now this is your chance. I will appreciate an answer whether it works or not.


  3. #3
    Join Date
    Jun 1999
    Posts
    4

    Re: how to delete running file

    There is exhaustive article on the theme. You can find it on http://msdn.microsoft.com/library/pe...F1/D2/SF9C.htm




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

Featured