Diese Seite ist noch nicht auf Deutsch verfügbar, daher zeigen wir die englische Version.

Windows CMD Commands Cheat Sheet

The Command Prompt (cmd.exe) commands that still matter — copying and finding files, fixing the network, killing processes, repairing Windows and writing small batch scripts — each explained in one line.

Aktualisiert am
Your valuesEvery example below updates as you type

Navigation & files

11
dir /s /b *.txt

List files of one type in the folder and all subfolders, one full path per line.

cd /d C:\Projects\app

Change folder — /d also switches the drive letter.

mkdir C:\Projects\app\logs

Create a folder (missing parent folders are created too).

copy app.log C:\Projects\app\backup\

Copy a file.

xcopy C:\Projects\app D:\backup\ /e /i /h /y

Copy a folder with all subfolders and hidden files.

robocopy C:\Projects\app D:\backup /mir /r:2 /w:5

destructive Mirror a folder — reliable for large copies; /mir also deletes files missing in the source.

move app.log C:\Projects\app\archive\

Move or rename a file.

del /q C:\Projects\app\*.tmp

destructive Delete files without asking.

rmdir /s /q C:\Projects\app\temp

destructive Delete a folder and everything in it.

type app.log

Print a text file’s content.

tree C:\Projects\app /f

Show the folder structure, including files.

Search & text

5
findstr /s /i /n "error" *.txt

Search files for text — recursive, case-insensitive, with line numbers.

where npm

Show the full path of a program on the PATH (like which).

npm | findstr "error"

Filter a command’s output for lines containing text.

echo %PATH:;=&echo.%

Show each PATH folder on its own line.

fc file1.txt file2.txt

Compare two text files and show the differences.

System & processes

8
tasklist | findstr node

Find running processes by name.

taskkill /im node.exe /f

destructive Force-kill a process by name.

systeminfo

Show Windows version, install date, memory and hotfixes.

sfc /scannow

Check and repair protected Windows system files (run as administrator).

DISM /Online /Cleanup-Image /RestoreHealth

Repair the Windows image when sfc can’t fix files.

chkdsk C: /f

Check the drive for file-system errors and fix them (needs a restart for C:).

shutdown /r /t 0

destructive Restart immediately.

powercfg /batteryreport

Create an HTML battery health report.

Network

8
ipconfig /all

Show IP addresses, DNS servers and adapter details.

ipconfig /flushdns

Clear the DNS cache — fixes many “site not found” problems after DNS changes.

ping -n 4 example.com

Check whether a host responds.

tracert example.com

Show the route packets take to a host.

nslookup example.com

Look up DNS records.

netstat -ano | findstr :3000

Find which process (PID) is using a port.

curl -I https://example.com

Show a site’s HTTP response headers (curl ships with Windows 10+).

netsh wlan show profile name="Home-Network" key=clear

Show a saved Wi-Fi network’s password (“Key Content”).

Variables & scripting

7
set API_URL=value

Set an environment variable for this window.

setx API_URL "value"

Set an environment variable permanently (new windows only).

echo %API_URL%

Print a variable’s value.

for %f in (*.txt) do echo %f

Loop over files (use %%f inside a .bat file).

if exist app.log (echo found) else (echo missing)

Branch on whether a file exists.

npm > out.txt 2>&1

Save both normal output and errors to a file.

npm && echo OK || echo FAILED

Run the next command only if the previous one succeeded (or failed).

Deine Daten verlassen nie deinen Computer. Die Verarbeitung erfolgt zu 100 % lokal im Browser.

So nutzt du: Windows CMD Commands Cheat Sheet

  1. Type your own values (folder, file, host) in the boxes at the top — every example on the page updates instantly.
  2. Search or jump to a section to find the command you need.
  3. Click Copy to copy a ready-to-run line, or Copy section for a commented block.
  4. Commands marked destructive delete or overwrite data — read the note before running them.

When to use CMD

PowerShell is the modern Windows shell, but Command Prompt is still everywhere: batch files, installers, recovery mode and many documentation snippets assume cmd.exe. Its commands are short and stable — ipconfig, robocopy, sfc and netstat have worked the same way for decades — and they also run inside PowerShell.

Batch file gotchas

Inside a .bat file, loop variables need two percent signs (%%f instead of %f). Variables set inside a parenthesized block need setlocal EnableDelayedExpansion and !var! syntax to see their new value. Save batch files with CRLF line endings — the line ending converter fixes files edited on macOS or Linux.

Run as administrator

Repair and system commands such as sfc, DISM, chkdsk and service changes need an elevated prompt: search for “cmd”, right-click and choose Run as administrator. Compare with the PowerShell cheat sheet.

Auch gesucht als: cmd commands, windows cmd commands, command prompt commands, cmd cheat sheet, batch commands, windows command line, robocopy examples, findstr examples.

Passende Tools zu: Windows CMD Commands Cheat Sheet

  • Linux Commands Cheat Sheet — The Linux and bash commands developers use on servers and laptops — files, search, permissions, processes, logs, networking and SSH.
  • Windows Path Converter — Paste a path in any format — C:\Users\me\project, /mnt/c/Users/me/project, /c/Users/me — and get it in every other form, ready to copy: WSL, Git Bash, Cygwin, file URL, UNC and escaped for code.
  • Git Cheat Sheet — Every Git command you use day to day — and the ones you need when something goes wrong — explained in one line.
  • Docker Cheat Sheet — The Docker and Docker Compose commands you reach for every week, explained in one line.

Häufige Fragen

How do I find which program is using a port?
Run netstat -ano | findstr :3000 to get the PID, then tasklist | findstr PID or end it with taskkill /pid PID /f.
What is the difference between xcopy and robocopy?
robocopy is the modern replacement: it resumes, retries, copies permissions and can mirror folders. xcopy is simpler and still works for quick copies.
How do I see a saved Wi-Fi password?
Run netsh wlan show profile name="NetworkName" key=clear — the password is shown as “Key Content”.
Kann ich Windows CMD Commands Cheat Sheet als Web-App installieren und offline nutzen?
Ja. Windows CMD Commands Cheat Sheet ist eine installierbare Web-App (PWA) – sie wird über Ihren Browser installiert und nicht aus einem App-Store heruntergeladen. Klicken Sie oben auf dieser Seite in Chrome oder Edge (Windows, macOS, Linux, ChromeOS) auf „App installieren“ oder verwenden Sie auf Android-Geräten „Teilen“ → „Zum Startbildschirm hinzufügen“ auf dem iPhone und iPad bzw. „Datei“ → „Zum Dock hinzufügen“ in Safari 17+ auf einem Mac. Die App öffnet sich dann in einem eigenen Fenster mit einem eigenen Symbol, und da sie vollständig in Ihrem Browser ausgeführt wird, funktioniert sie auch offline. Firefox auf dem Desktop kann keine Web-Apps installieren. So funktioniert die Installation.

Ähnliche Tools