-
Aug 11th, 2015, 04:02 AM
#1
Thread Starter
New Member
stopping a background process from task manager
Hey there everyone,
I got a little problem!
I wanted to execute a program which I deliver with my software package, but after running it I can't kill the task.
I used this:
Code:
For Each p As Process In Process.GetProcessesByName("helper.exe")
p.Kill()
Next
That won't work because it's... I don't really know!
I even tried to make it a process in a separate SUB but that won't work either.
Can someone please help me out here?
With kind regards,
Dennis
Last edited by teambiohazard; Aug 12th, 2015 at 05:09 AM.
-
Aug 11th, 2015, 05:00 AM
#2
Member
Re: stopping a background process from task manager
this may help?
Process[] procs = Process.GetProcessesByName("helper");
foreach (Process proc in procs)
proc.Kill();
-
Aug 11th, 2015, 05:13 AM
#3
Thread Starter
New Member
Re: stopping a background process from task manager
nope, I got a bunch of errors. tried to modify the code you gave but can't figure out what will solve it.
I am using visual studio 2010 windows form application.
-
Aug 11th, 2015, 05:19 AM
#4
Member
Re: stopping a background process from task manager
OK can you remove the .exe from you're sample code or heres the converted to VB code
Code:
Dim procs As Process() = Process.GetProcessesByName("helper")
For Each proc As Process In procs
proc.Kill()
Next
-
Aug 11th, 2015, 05:38 AM
#5
Thread Starter
New Member
Re: stopping a background process from task manager
still not working. it seems that the file doesn't get terminated.
-
Aug 11th, 2015, 05:50 AM
#6
Member
Re: stopping a background process from task manager
are you running VS with admin rights? You may need Admin.
-
Aug 11th, 2015, 06:23 AM
#7
Re: stopping a background process from task manager
Ok... help me out here... WHAT application are you trying to terminate? Yours? Or something else? Is the process trying to kill itself? O.o
-tg
Last edited by techgnome; Aug 11th, 2015 at 06:31 AM.
-
Aug 12th, 2015, 04:23 AM
#8
Thread Starter
New Member
Re: stopping a background process from task manager
Originally Posted by techgnome
Ok... help me out here... WHAT application are you trying to terminate? Yours? Or something else? Is the process trying to kill itself? O.o
-tg
I am trying to terminate my server application.
and it isn't really the purpose to end itself
-
Aug 12th, 2015, 04:56 AM
#9
Re: stopping a background process from task manager
So at a guess do you have a client and a server application and you trying to kill the Server app from the Client?
Is your server application running on the same machine?
If you debug and step through fenster89411's code - does it even find your helper application?
Code:
Dim procs As Process() = Process.GetProcessesByName("helper")
For Each proc As Process In procs
proc.Kill()
Next
If you put a breakpoint on proc.kill does it even get hit when you run the code?
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Aug 12th, 2015, 05:09 AM
#10
Thread Starter
New Member
Re: stopping a background process from task manager
Originally Posted by NeedSomeAnswers
So at a guess do you have a client and a server application and you trying to kill the Server app from the Client?
Is your server application running on the same machine?
If you debug and step through fenster89411's code - does it even find your helper application?
Code:
Dim procs As Process() = Process.GetProcessesByName("helper")
For Each proc As Process In procs
proc.Kill()
Next
If you put a breakpoint on proc.kill does it even get hit when you run the code?
Thanks!
-
Aug 12th, 2015, 08:29 AM
#11
Re: stopping a background process from task manager
Thanks for what exactly?
i asked you a bunch of questions, did they help you understand what your problem was?
and if you fixed your issue can you post back what was actually wrong and how you fixed it?
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Aug 12th, 2015, 08:47 AM
#12
Re: stopping a background process from task manager
And yet it was the exact same code previously posted that he said was "still not working" ...
-tg
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
|