I wanted to determine the command-line arguments of a running process at the Command Prompt (cmd.exe).
E.g., if I started my abc.exe program as follows:
abc -d
I want to determine the whole command line later. The TASKLIST utility does not provide this info, because it just reports the exe name and not the arguments with which the process was started.
Here is a GUI-based method (Tested on Windows 7 - YMMV). I don't know of an easy method to get this data from the command-line.
Command-line method:
Use the Get-WmiObject to list processes and filter the process name above. Add/remove fields through the select statement below - example:
Get-WmiObject win32_process -Filter "name like '%notepad.exe'"|select CreationDate,ProcessId,CommandLine|ft -AutoSize
Note: The process name "notepad.exe" is used for this example, substitute the name for your specific scenario.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With