finding out "Process ID" via cmd Console

Tech-Archive recommends: Fix windows errors by optimizing your registry



I have a cmd file (batch file) which starts an exe after setting
parameters. I need to find out the Process ID of the exe via a
command. The problem is that my program, written in C# only knows the
PID of the cmd file. I don't want to use a method like
GetAllProcesses(). If I want to kill the processes (both the cmd and
the exe) I have to kill the exe. Otherwise the exe process is still
alive. The "taskkill" command is also not helpful because the program
itself can be started for several times. That's why the name of the
process doesn't really help to kill it.

Thanks for help.

.



Relevant Pages

  • Re: NetDiag in a CMD file ?
    ... What I was missing was the quotes on both sides of the path to the exe. ... But if I want to run this .cmd file which is on the desk of my PC, ... commands by typing this command at the Command Prompt: ...
    (microsoft.public.windows.server.general)
  • finding out "Process ID" via cmd Console
    ... I have a cmd file which starts an exe after setting ... the exe) I have to kill the exe. ... The "taskkill" command is also not helpful because the program ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: INSTALL.CMD
    ... when you put the EXE file inside the CMD file. ... install it in a certain way, but it also works any other way. ...
    (comp.lang.rexx)
  • Re: finding out "Process ID" via cmd Console
    ... PID of the cmd file. ... the exe) I have to kill the exe. ... The "taskkill" command is also not helpful because the program ...
    (microsoft.public.dotnet.languages.csharp)
  • Any Way to Run CMD as a Service
    ... I have a simple CMD file that I need to run as a service. ... Resource Toolkit provides a way to install an EXE as a service, ...
    (microsoft.public.windows.server.general)