Command Prompt Textbook
Introduction to Command Prompt
Four ways to close Command Prompt: the × button, the right-click menu, the exit command, and Alt + F4. Also covers what
Files containing commands that run on Command Prompt can have .bat or .cmd extensions. This page explains how they work
Command Prompt is effective for automating and streamlining tasks on Windows 11. Here are three methods to launch Comman
Learn how to run Command Prompt as administrator. Covers two methods, the Run dialog and the Start menu, and how to conf
List of Commands
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
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
This article provides a detailed explanation of the `CLS` command in the command prompt, including specific examples. It
Learn how to use the copy command in Command Prompt and batch files to copy files and folders. This guide covers the bas
Learn how to delete files with the del (erase) command in Command Prompt and batch files: wildcards, the /s /q /f /a opt
Learn how to list and search files with the dir command (the Windows counterpart of Unix ls): wildcards, subfolder searc
Learn how to display text in Command Prompt and batch files with the echo command: what "@echo off" means, how to print
Tips
Learn how to effectively pass arguments to batch files, from basic usage to advanced options. This guide provides clear
Learn how to make a batch file automatically display the UAC elevation dialog and restart itself with administrator priv
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
Fix variables that do not update inside FOR loops and IF blocks in batch files. Learn how setlocal enabledelayedexpansio
How to delete files and folders in Command Prompt and batch files. Covers when to use del and rmdir, wildcards, deleting
Learn the causes of garbled text in the command prompt and batch files, and how to fix it. Covers changing the code page