Click here to Skip to main content
12,302,084 members (57,717 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# Process
How to get Process Command Line, Parent Process ID & Username in C#, When you pass pid or process name.

Thanks for replying.

NO WMI PLEASE.

I already have: VB .NET ( YAPM ), AutoIt (NTQuery..(), zswQuer...()), C++ with MFC/COM ( NTPROCESSINFO.h ).

I tried to convert vb .net to c# but the project is big & conversion doesn't complete only & also i had extracted the code for cmdline but there is only arithmetic overflow exception.

I don't want EnumerateProcess/Service(), I want getProcessCmdLine(pid) function in C#.

Similarly for others.

If anybody has already created the class or methods only, please share.
Posted 23-Oct-12 5:32am
sameeruvw4.3K
Edited 23-Oct-12 20:25pm
v3
Comments
sameeruvw 24-Oct-12 2:26am
   
Thanks for replying.

NO WMI PLEASE.

I already have: VB .NET ( YAPM ), AutoIt (NTQuery..(), zswQuer...()), C++ with MFC/COM ( NTPROCESSINFO.h ).

I tried to convert vb .net to c# but the project is big & conversion doesn't complete only & also i had extracted the code for cmdline but there is only arithmetic overflow exception.

I don't want EnumerateProcess/Service(), I want getProcessCmdLine(pid) function in C#.

Similarly for others.

If anybody has already created the class or methods only, please share.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Use the Win32_Process WMI class[^]. Here is a good tutorial about how you can do this in c#: How To: (Almost) Everything In WMI via C# Part 2: Processes[^]
  Permalink  
Comments
sameeruvw 24-Oct-12 2:26am
   
Thanks for replying.

NO WMI PLEASE.

I already have: VB .NET ( YAPM ), AutoIt (NTQuery..(), zswQuer...()), C++ with MFC/COM ( NTPROCESSINFO.h ).

I tried to convert vb .net to c# but the project is big & conversion doesn't complete only & also i had extracted the code for cmdline but there is only arithmetic overflow exception.

I don't want EnumerateProcess/Service(), I want getProcessCmdLine(pid) function in C#.

Similarly for others.

If anybody has already created the class or methods only, please share.
Zoltán Zörgő 24-Oct-12 5:02am
   
Sorry, I have no resources to follow your strange wishes.
sameeruvw 17-Nov-12 5:20am
   
Thanks but i got c# cmdline, parent pid & username in c#
sameeruvw 17-Nov-12 5:20am
   
Solved
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You may find this piece of documentation interesting: Process Class at MSDN[^].
  Permalink  
Comments
sameeruvw 24-Oct-12 2:26am
   
Thanks for replying.

NO WMI PLEASE.

I already have: VB .NET ( YAPM ), AutoIt (NTQuery..(), zswQuer...()), C++ with MFC/COM ( NTPROCESSINFO.h ).

I tried to convert vb .net to c# but the project is big & conversion doesn't complete only & also i had extracted the code for cmdline but there is only arithmetic overflow exception.

I don't want EnumerateProcess/Service(), I want getProcessCmdLine(pid) function in C#.

Similarly for others.

If anybody has already created the class or methods only, please share.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Solved

I Have c# cmdline, parent process id, username
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160530.1 | Last Updated 17 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100