Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query commandline for a running process

Status
Not open for further replies.

aloodb

Technical User
Oct 30, 2003
4
GB
Anyone know how to query the commandline of a running process on win2k ? I've found the getcommandline win32 api but that only returns a pointer to the commandline for the current process I need to be able to retrieve the commandline for a different process than I'm running in. The reason I need this is I have several running processes that all appear identical in the windows tasklist, as the only thing that differentiates them are the parameters supplied when they were started. So to be able to know which ones are still running I need to be able to query the commandline parms. Preferably using Visual Basic 6.0 but any pointers on how to do it would be great as I'm totally stumped.
 
You might want to look at a command line tool called WMIC. Basically it is a command line to interface with WMI.
When you are at a command line type 'wmic'. It will bring up a CLI for WMI connected to the default root namespace. Then type 'process' and it will list all processes running on the system and the command line path. It can also be used to query and manipulate specific processes.

Very powerful and not very well known tool.

HTH----Z
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top