dcsimg
Results 1 to 8 of 8

Thread: [RESOLVED] delete running application

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2009
    Posts
    134

    Resolved [RESOLVED] delete running application

    Hi Guys,

    I am trying to delete a running application is this possible. Here is what i mean.
    If you have a program running you know when you try to delete it, a message pops up " this program is being used Bla Bla Bla ..."
    I want to delete that program even if its being used.
    Is this possible?
    I heard shell can do something like that!!!
    Any ideas i would really evaluate them
    Last edited by ammar555; Jun 4th, 2009 at 06:12 PM.
    IF you think that helped you please rate me
    Also go to Thread Tools And Choose ""Mark Thread AS Resolved "

  2. #2
    Frenzied Member Bulldog's Avatar
    Join Date
    Jun 2005
    Location
    South UK
    Posts
    1,950

    Re: delete running application/ Process

    I think you can use taskkill to kill anything;

    Shell("taskkill /im TheProcessName.exe /f")

    or alternatively by doing something like;

    Code:
    For Each Proc As Process In Process.GetProcessesByName("TheProcessName")            
        Proc.Kill()
    Next


    • If my post helped you, please Rate it
    • If your problem is solved please also mark the thread resolved

    I use VS2015 (unless otherwise stated).
    _________________________________________________________________________________
    B.Sc(Hons), AUS.P, C.Eng, MIET, MIEEE, MBCS / MCSE+Sec, MCSA+Sec, MCP, A+, Net+, Sec+, MCIWD, CIWP, CIWA
    I wrote my very first program in 1979, using machine code on a mechanical Olivetti teletype connected to an 8-bit, 78 instruction, 1MHz, Motorola 6800 multi-user system with 2k of memory. Using Windows, I dont think my situation has improved.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2009
    Posts
    134

    Re: delete running application/ Process

    Quote Originally Posted by Bulldog View Post
    I think you can use taskkill to kill anything;

    Shell("taskkill /im TheProcessName.exe /f")

    or alternatively by doing something like;

    Code:
    For Each Proc As Process In Process.GetProcessesByName("TheProcessName")            
        Proc.Kill()
    Next
    sorry i didn't mean this
    i meant... imagine that you have a program in your desktop with name of "Media.exe"

    You want to delete that program while its running.
    how can you do that?
    Delete it from the desktop while the program is running.
    I didn't mean to first close it and then delete it.
    I want to delete it while its running.
    Thanks anyway
    IF you think that helped you please rate me
    Also go to Thread Tools And Choose ""Mark Thread AS Resolved "

  4. #4
    Frenzied Member Bulldog's Avatar
    Join Date
    Jun 2005
    Location
    South UK
    Posts
    1,950

    Re: delete running application

    So use two steps, kill the process then delete the executable.

    Why do you need to do this?, it seems a strange requirement. Are you writing something nasty?


    • If my post helped you, please Rate it
    • If your problem is solved please also mark the thread resolved

    I use VS2015 (unless otherwise stated).
    _________________________________________________________________________________
    B.Sc(Hons), AUS.P, C.Eng, MIET, MIEEE, MBCS / MCSE+Sec, MCSA+Sec, MCP, A+, Net+, Sec+, MCIWD, CIWP, CIWA
    I wrote my very first program in 1979, using machine code on a mechanical Olivetti teletype connected to an 8-bit, 78 instruction, 1MHz, Motorola 6800 multi-user system with 2k of memory. Using Windows, I dont think my situation has improved.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2009
    Posts
    134

    Re: delete running application

    Quote Originally Posted by Bulldog View Post
    So use two steps, kill the process then delete the executable.

    Why do you need to do this?, it seems a strange requirement. Are you writing something nasty?
    LOl

    Maybe, But thank you very much for the help!
    IF you think that helped you please rate me
    Also go to Thread Tools And Choose ""Mark Thread AS Resolved "

  6. #6

    Re: [RESOLVED] delete running application

    To my knowledge, it is impossible to delete an application that is currently being used by either the system or another process, because the memory of the program is being read/written to.

    And I agree with Bulldog, are you writing something you shouldn't?

  7. #7

    Re: delete running application

    Quote Originally Posted by ammar555 View Post
    LOl

    Maybe, But thank you very much for the help!
    Not helping your case man.

  8. #8
    Member
    Join Date
    Apr 2009
    Posts
    37

    Talking Re: [RESOLVED] delete running application

    Using:

    Code:
    Shell("taskkill /im TheProcessName.exe /f")
    My.Computer.FileSystem.DeleteFile("TheProcessName.exe")
    ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width