Pcornel
Browse topics
Options
Recent
Favorites
Windows · Technical reference

Pipes

Direct answer

Pipes (|) send one command's output into another's input in cmd, such as ipconfig /all | findstr IPv4 or netstat -ano | find "443", to filter or chain results.

When to use this

Use this when chaining cmd output into filters.

First 30 seconds

1. Test each command alone.

2. cmd1 | cmd2 — only stdout is piped.

3. Include errors: 2>&1 |.

4. Filter with findstr.

5. Check ERRORLEVEL of the last command.

Operational verification

cmd1 stdout → pipe → cmd2 stdin → output

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Expecting findstr to match PowerShell objects (convert with Out-String -Stream or use Where-Object).
  • Piping large outputs through more in scripts (waits for input).
  • Losing exit codes in pipelines (%ERRORLEVEL% reflects the last command).
Platform / version applicability
Windows execution, automation and observability
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformWindows execution, automation and observability
Scope / prerequisiteUse this when chaining cmd output into filters.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Pipes pass text, not objects.
  • Use findstr to filter lines.
  • Errors (stream 2) are not piped unless redirected with 2>&1.
Key checks
  • echo %PATH% — PATH in CMD
  • set — environment variables
  • where <name> — command resolution
  • echo %ERRORLEVEL% — exit code
ReferenceWhy it matters1 section · depth on demand

Examples

ipconfig /all | findstr /i "IPv4 DNS"
netstat -ano | findstr :443
tasklist | findstr /i chrome
type log.txt | find /c "ERROR"

Documented example, not captured output. cmd pipes pass text; PowerShell pipes pass objects (Get-Process | Where CPU -gt 100).

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Pipes in cmd pass text output of one program to the input of the next:

netstat -ano | findstr :443
tasklist /svc | findstr /i spooler
ipconfig /all | find "DNS Servers"
type big.log | more
wmic process get name,processid | sort

findstr supports simple regex (/r) and case-insensitivity (/i). Unlike PowerShell, cmd pipes are plain text — parse carefully or switch to PowerShell for anything structured.

cmd vs PowerShell pipes

In cmd, the pipe passes text from one program to the next (netstat -ano | findstr :443). In PowerShell it passes objects (Get-Process | Where-Object CPU -gt 100 | Sort-Object CPU). Native executables in PowerShell still output text, so use Select-String instead of findstr for consistency.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docWindows execution, automation and observability current

Authoritative/upstream documentation reviewed for bounded claims in Command Prompt → Pipes. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands · confidence 94%
Confirmation

Confirm action

Continue?