|
-
December 1st, 2009, 05:38 AM
#1
Kill an executable File subroutine
Hallo,
I would like to write a sub routine to kill an executable file called 'dfsvc.exe'. I'll call this subroutine when I exit my application to kill this file. When I exit my application this file is still running and takes around 15 minutes before it disappears. I would like to kill it to remove the delay.. The following code below doesnt work.. any ideas please
Private Sub Kill()
Dim aProcess As System.Diagnostics.Process
aProcess = System.Diagnostics.Process.GetProcessesByName("dfsvc.exe")
aProcess.Kill()
End Sub
Thanks
-
December 2nd, 2009, 08:45 AM
#2
Re: Kill an executable File subroutine
What you have written kills the process, and not the actual file.
Try looking into the System.IO namespace and then using the File.Delete method.
If the exe is running, you might battle to delete it...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|