On a database, I can get a list of all the currently running processes, and the sql command that kicked them off.
I'd like to do a similar thing on a windows box.
I can get the list of processes, but not the command line that kicked them off.
My question is: Given a PID on Windows – how do I find the command line instruction that executed it?
Assumptions:
- Windows 7 and equivalent servers
Best Answer
Powershell and WMI.
Or
Note that you have to have permissions to access this information about a process. So you might have to run the command as admin if the process you want to know about is running in a privileged context.