Windows Develop Bookmark and Share   
 index > Windows Forms General > To get the process Id from .exe name or to get the ProcessId while execution of batch file name
 

To get the process Id from .exe name or to get the ProcessId while execution of batch file name

Hi All,

I guess i m in right forum, else plaese suggest me the right forum.

Here is my query,

Consider i m two running java.exe in processes. and i watnted to terminate one amongs them.
SO i guess i should have processId to terminate that process.

So i what i need is to get the processsID while the launch of batch file. so that later i can refer to that and kill the process.

Is that possible to get the processId while execution of batch file?

Thanks in advance.

BhuvanMP  Thursday, July 31, 2008 11:05 AM
You can get the process ID of the program that is running the .bat file, cmd.exe. That's not going to be very useful. You'll need to start java.exe yourself with the Process class. Using Process.GetProcessByName() before you run the .bat file, then again after running the .bat file and look for the added process could work too but is not 100% reliable.

This has to be a common problem with the JVM. Try a java support forum.
nobugz  Thursday, July 31, 2008 11:43 AM
You can get the process ID of the program that is running the .bat file, cmd.exe. That's not going to be very useful. You'll need to start java.exe yourself with the Process class. Using Process.GetProcessByName() before you run the .bat file, then again after running the .bat file and look for the added process could work too but is not 100% reliable.

This has to be a common problem with the JVM. Try a java support forum.
nobugz  Thursday, July 31, 2008 11:43 AM

You can use google to search for other answers

Custom Search

More Threads

• Integrate the MultiColumn ComboBox into DataGridViewColumn
• TextBox text selectable but not editable
• WS_EX_NOACTIVATE bug while dragging/resizing
• Create generic class for method ContainsKey
• Accsessing usercontrol elements
• VPN Connction
• Dynamically choosing a UI library
• Customizing AxWebBrowser content while printing
• Application examples using MS Exception Application Block
• Form blocked by modal form still receives keyboard input.