Link to home
Start Free TrialLog in
Avatar of nomar2
nomar2

asked on

How to kill an application exe in the task manager in VB.Net when a program crashes..

I built and published a project in VB.net..this works ... I have a shortcut placed on the desktop...the problem is if the program crashes on expectedly and I try to start it up again ...it won't startup again.. I have to go into the task manager and find the project.exe and "end task" and once this is done I can startup the program again...also if I close the program using a close button on my form with the following code underneath it   " appilcation.exit" ..it still shows the  "project.exe " in the task manager and thus I can't restart it again..

I am wondering if  there is anyway when I can click the shortcut icon on my desktop ..it could launch a piece of code that searches the task manager for the project.exe and if it finds it is there , then "end task" for the project.exe and then launch the project.

Or there another way around this..

Any insight or help would be much appreciated..
Avatar of ZachSmith
ZachSmith
Flag of United States of America image

The issue here is that the process isn't completely killing itself. You need to find a way to get the process to cleanup after it closes. Are you using threading in this application?
Avatar of nomar2
nomar2

ASKER

I am still learning VB.net ..but what I know about threading I would say no I am using threading..
Avatar of Mike Tomlinson
If you don't have threading then surely you must have some kind of infinite loop keeping the application from exiting properly.

What does your app do?  Do you have any procesing loops?  Show us some code if possible...
ASKER CERTIFIED SOLUTION
Avatar of mastoo
mastoo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nomar2

ASKER

Now that I think about it....the project has several forms with tab controls and on those forms there are a couple of timers ( threading??)

Maybe one of the timers is not stopped....  Is there a right and wrong way to deal with timers??

Timers can be threaded (depending on which one you used) but they shouldn't keep the app from closing...