473,608 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

finding out "Process ID" via cmd Console

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.

Jun 11 '07 #1
1 8312
try here: http://forums.microsoft.com/MSDN/Sho...62676&SiteID=1

Christoph je napisao/la:
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.
Jun 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8582
by: Greg Bryant | last post by:
I'm doing some work for a company that has an auction site running in coldfusion. They're not real happy with it, and it needs a major overhaul, so I'm looking at redoing it, and while I'm at it, might as well move to PHP (for a variety of reasons - not trying to reopen the PHP -vs- CFM thing again :). Anyway, so I'm looking at this system, and there are no "scheduled tasks" (it's win2kas). How do you write a server app that needs to...
4
2334
by: Jochen Demuth | last post by:
Hi, I am trying to install ZWiki on Zope 2.5.1 / Debian 2.4.20-bf2.4-xfs. First I copied the contents of the ZWiki-0.32.0.tgz to the Products-directory under SOFTWARE_HOME: This is what it contained before: server1:/usr/lib/zope/lib/python/Products# ls ExternalMethod PageTemplates StandardCacheManagers ZSQLMethods Hotfix_2002-06-14 PluginIndexes TemporaryFolder ZopeTutorial
10
2306
by: Generic Usenet Account | last post by:
I have worked out a very simple method for tracking the "memory growth" of a process at run time. It involves a header file and a shell script. Here's the header file: ////////// Header File Begin /////////////// #ifndef _VIRTMEMINFO_H_ #define _VIRTMEMINFO_H_ #include <stdio.h>
3
2084
by: kj | last post by:
This problem is driving me nuts. The code at the end of this post below works fine with IE, but fails with Mozilla. You can see it in action at http://tinyurl.com/2jvo3 With Mozilla 1.4 and 1.6, the function msg works fine if it's installed as an onclick handler for the button, but fails as an onload handler for the page. The error is "console has no properties", and is triggered by the line.
13
2503
by: baumann.Pan | last post by:
when define char *p = " can not modify"; p ='b' ;is not allowed, but if you declare p as char p = "can modify"; p = 'b'; is ok? why?
1
2496
by: Omer kamal | last post by:
When in database(.mdb) the primary key have fields size type "Replication ID" it creates Guid. I tried to create string of Guid and insert it but did it not work. Control.databindings.add(), Method for this field is only working one way that,it is not saving back the data into table. I wonder if there is some way so it creat automatic Guid when I add new field?
2
1471
by: jain_tj | last post by:
Could anyone please help me with the following problem My xml file is ============== <fig id="F0000001"> <caption>Caption text</caption> <image id="I0000001" image.class="halftone" image.type="jpg" print="0" width="29-6" depth="23-6" pointer="I0000001.jpg"/> </fig>
5
1605
by: Matt | last post by:
Ok so I'm trying to run a simple dos command shell through a VB.NET 2005 program. The oddest thing is happening given the following piece of code: '============================================================ '=== VARIABLE DECLARATION AND INITIALIZATION ================ '============================================================ '---General Variables------------------------------------ Dim CMDProcess As Process = New Process
1
1287
by: drnicwilliams | last post by:
The Prototype library gives us the $() operation for converting a DOM element id into the DOM element: $('element-id'). It also appends a bunch of functions to the resulting object. Sometimes though, passing a string into the $() function doesn't read well; and only makes Javascript code harder to read. For example: $(window.button_list()).hide() Instead, it'd be nice to have normal chainability. I like the following syntax:...
0
8000
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8470
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5475
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4023
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.