CMD Master
Back to Blog
Arnošt Havelka

Practical: Batch Intro

Write your first automation script.

Start Interactive Lesson
Practical: Batch Intro

Practical: Your First Batch Script

A batch file is simply a text file containing a list of commands that are executed in sequence. They end with the .bat or .cmd extension.

The Mission

You will create a simple script called hello.bat that:

  1. Clears the screen.
  2. Prints a welcome message.
  3. Pauses so the window doesn't close immediately.

Step 1: Create the Script

We will use copy con to write the script directly.

Command Prompt
C:\Users\User>copy con hello.bat

Step 2: Run the Script

Execute it by typing its name.

Command Prompt
C:\Users\User>hello.bat

Key Commands Explained

Step 3: A More Useful Script (System Info)

Let's make a script that shows IP information.

Command Prompt
C:\Users\User>copy con network.bat

Knowledge Check

1 / 3

What file extension is used for batch scripts?

Up Next

Practical: File Mgmt

Real-world scenario: Organize your downloads folder.