CMD Master
Back to Blog
Arnošt Havelka

Introduction to Batch Files

Automate your daily tasks.

Start Interactive Lesson
Introduction to Batch Files

A batch file is simply a text file containing a list of commands. When you run the file, the computer executes the commands in order. It's the simplest form of coding on Windows.

Try the command

Run a batch file!

Build the command
.batStandard extension for batch files.
Terminal
C:\Users\Student>backup.bat
Starting Backup... Backup Complete!

Sample Script

daily_backup.bat

@echo off
mkdir Work 2>nul
echo Quarterly report>Work\report.txt
echo Starting Backup...
xcopy Work Backup /s /e /i /y
echo Backup Complete!
pause

Knowledge Check

1 / 2

What is the file extension for a batch script?

References

These documentation links provide authoritative details for the commands used in this article.

Up Next

Advanced Batch

Master loops, conditions, and flow control.