See the Full Command Line Behind a Process (Win32_Process)

Use Get-CimInstance Win32_Process to reveal the exact command line that started each process — great for spotting look-alikes.

WindowsProcesseswmisystempowershellLow risk
Run `Get-CimInstance Win32_Process | Select-Object ProcessId, Name, CommandLine` and read the CommandLine column to see how each process was really launched.

01Command

Command
$ Get-CimInstance Win32_Process | Select-Object ProcessId, Name, CommandLine

02What it does

Task Manager only shows a process name, but malware and suspicious scripts often hide in the arguments. Win32_Process exposes the CommandLine property with the complete launch string, so you can tell genuine svchost.exe activity from a fake file named similarly in an odd folder. Filter with Where-Object on Name or PID to inspect a single process.

03Risk

RiskLow risk
!Warning: A command line can contain passwords or API keys passed as arguments — don't paste the output publicly.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Win32_Process class
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Class definition lists the CommandLine string property ('the command line used to start a specific process') alongside ProcessId and Name.
  • Get-CIMInstance — Get WMI/CIM class instances
    SS64 · technical · 2026-09-17
    Evidence: Syntax shows Get-CimInstance -ClassName <String> usage for querying CIM/WMI classes such as Win32_Process, piped to Select-Object for chosen properties.

Last verified: 2026-09-19 · Category: System & Settings

06Related solutions