Friday, March 19, 2021

Displaying Command Line Arguments on Windows without Installing Additional Software?

On Windows, can we obtain from the command line a process's command line arguments without installing any additional software like the Process Explorer of the Windows Sysinternal? As documented by a Stack Overflow discussion, the answer is Yes, via WMIC. Here are two examples,

  1. List all processes and their command line arguments
    
      WMIC path win32_process get Caption,Processid,Commandline
      
  2. List a process, e.g., chrome.exe, and its command line arguments
    
      WMIC path win32_process where "caption='chrome.exe'" get Caption,Processid,Commandline