Get the complete command line of a process [duplicate]

Solution 1:

[Sysinternals Process Explorer][1] is a much more powerful process manager.

It has, among other features, the one you're looking for: Right-click a process, click "Properties", and click the "Image" tab on the popup window. It should have a copy-able "Command line" section

If you don't want to install something new, you can use WMIC. To do this, open a command prompt and type

WMIC /OUTPUT:C:\Desired_location_here.txt PROCESS get Caption,Commandline,Processid

Then, open the text file and the second column should be what you're looking for [1]: http://technet.microsoft.com/en-us/sysinternals/bb896653

Solution 2:

Double-click a process in Process Explorer, it will display the command line in a edit-box. You can also use WMI:

If you look around in WMI, you’ll find a Win32_Process object, and lo and behold, it has a CommandLine property. Let’s check it out, using the standard WMI application:

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process")
For Each objItem in colItems
     Wscript.Echo objItem.Name
     Wscript.Echo objItem.CommandLine
Next