How to get the Username of a running process??

R

Randy Myers

Hi,

I know how to get the processes runging on a PC and information about them,
BUT:

How do get the username of that process? The same username that shows in
the Task manager list when you Cntrl+Alt+Del.

I tried the File Info Object, but didn't see any thing there.

I'm trying to check to to see if the same process is running on the same PC
under another user. Multiple processes are OKon same user, but not other
logins.
 
K

Ken Tucker [MVP]

Hi,

http://www.windowsformsdatagridhelp.com/default.aspx?ID=af026486-62bf-4304-9dd8-a07917f8c3e4

Ken
----------------
Hi,

I know how to get the processes runging on a PC and information about them,
BUT:

How do get the username of that process? The same username that shows in
the Task manager list when you Cntrl+Alt+Del.

I tried the File Info Object, but didn't see any thing there.

I'm trying to check to to see if the same process is running on the same PC
under another user. Multiple processes are OKon same user, but not other
logins.
 
R

Randy Myers

Thanks so much. You code works great and I understand it.

But where can I find information on WMI calls - like acceptable queryies and
the objects that can be queried? Also where can I find the calls like the
"GetOwner" you used?

I looked everywhere in Help and Object Browser.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top