Command Prompt Textbook
Introduction to Command Prompt
Four ways to close Command Prompt (× button, right-click menu, exit command, Alt + F4), plus how to stop a running comma
Learn the difference between the batch file extensions .bat and .cmd: the one real behavioral difference (ERRORLEVEL), w
How to open Command Prompt on Windows 11 and 10: Start search, Win+R, Windows Tools, the folder address bar and Task Man
How to run Command Prompt as administrator. Quick reference for the Shift+Ctrl+Enter shortcut, Start menu, Win+X, Task M
List of Commands
Learn how to view and change the link between file extensions and apps using the assoc and ftype commands in Command Pro
Use the attrib command in Command Prompt to view and change file and folder attributes: read-only, hidden, system, and a
Learn how to run another batch file from a batch file with the call command. Covers why control does not return without
Learn how to change directories with the cd (chdir) command in Command Prompt and batch files: moving to a parent direct
Learn how to use the CERTUTIL command to calculate SHA-256 or MD5 hashes and check that a downloaded file is not corrupt
Learn how to check and change the Command Prompt code page with the chcp command. Covers 932 (Shift_JIS) vs 65001 (UTF-8
Learn how to scan and repair drive errors and bad sectors with the chkdsk command. Covers the difference between /f and
Use the choice command to let the user pick Yes/No or other options in the command prompt or a batch file. Learn the /c,
Learn how to use the CLIP command to copy command output or text file contents to the clipboard. Covers pipes and redire
Learn how to clear the Command Prompt screen with the cls command. This guide covers batch file usage, differences from
Tips
Learn how to pass arguments to a batch file and read them with %1 and %2. Covers call versus start, counting arguments,
Learn how to make a batch file automatically display the UAC elevation dialog and restart itself with administrator priv
A beginner-friendly guide to creating batch files (.bat). Learn how to make one in Notepad, what @echo off means, how to
Use set /a to do math in Command Prompt and batch files. Covers arithmetic, remainders (%%), counters, random numbers, a
Learn the differences between &, &&, and || for running multiple commands on one line in Command Prompt. Covers grouping
Learn how to copy and paste text in Command Prompt. Ctrl+C and Ctrl+V work in Windows 10/11, while older versions or cer
Learn how to create a 0-byte empty file from Command Prompt or a batch file using type nul, copy nul, and echo;, with co
Learn how to create folders from Command Prompt or a batch file with the mkdir (md) command: nested folder structures, n
Use the cd command to display the current directory in Command Prompt or a batch file. Learn the difference between %cd%
Learn how to get and format the date and time in batch files. Covers the %DATE% and %TIME% variables, using them in file