Lab Activity: Windows CMD

3 sessions — Master the Windows Command Line

Grade XI • Computer Science ⏱️ 3 × ~20 min

Brief Intro — Windows CMD

The command line still matters because many powerful operations can only be done in CMD — from system administration to automation. However, be careful: commands like `del` and `rd` remove files permanently without sending them to the Recycle Bin.

In this lab, you'll master essential CMD commands for navigation, file management, and system control through three hands-on sessions.

Session 1 Environment & Navigation

Learn to navigate the command line environment and understand your system.

Interactive Simulator: Command Browser

Click a command in the dock below to see its syntax, purpose, and example output.

💻
Select a command from the dock

Task 1: Version Check

Use the `ver` command to identify which version of Windows you are currently running.

Command: ver
Purpose: Displays the current Windows version

Check Expected Output

Expected: Microsoft Windows [Version 10.0.xxxxx] or similar version information

Task 2: Date & Time

Display the system date and time using the `date` and `time` commands.

Commands: date and time
Purpose: Shows current system date and time
Check Expected Output

Expected: Current date in format and current time; may prompt to enter new values

Task 3: Directory Navigation

Navigate to the C: drive (or your user folder) using the `cd` command.

Command: cd <DIR> (e.g., cd Desktop)
Purpose: Change to specified directory
Hint: Use cd .. to go to parent directory
Check Expected Output

Expected: Prompt changes to show new directory path

Task 4: Directory Listing

Use the `dir` command to list all files and folders in the current directory.

Command: dir
Purpose: Lists all files and folders in current directory
Check Expected Output

Expected: List of directories and files with sizes, dates, and times

Task 5: Tree Structure & Help

Use `tree` to view the hierarchical structure and `help dir` or `dir /?` for documentation.

Commands: tree and help dir or dir /?
Purpose: `tree` shows folder structure graphically; `help` shows command documentation
Check Expected Output

Expected: `tree` shows ASCII tree structure; `help dir` displays syntax and options

Session 2 File & Directory Manipulation

Create, manage, and manipulate files and directories from the command line.

Interactive Simulator: Command Builder Challenge

Click command + target chips to build correct commands. See if you can construct the right syntax!

Build a command by clicking chips above

Task 6: Create Directories

Use `md` (make directory) to create three folders inside Lab_Work named: Docs, Images, and Temp.

Command: md <foldername> or mkdir <foldername>
Example: md Docs, md Images, md Temp

Check Expected Output

Expected: Command executes successfully; verify with `dir` to see new folders

Task 7: Create Files with echo

Use `echo Hello World > welcome.txt` to create a file containing text.

Command: echo Hello World > welcome.txt
Purpose: Creates a file with the specified text content
Check Expected Output

Expected: File created; verify with `type welcome.txt` to see content

Task 8: Create Files with copy con

Use `copy con mynotes.txt` to create a file, type two lines of text, then press Ctrl+Z and Enter to save.

Command: copy con mynotes.txt
Purpose: Creates a file by typing directly from the command line
Important: Press Ctrl+Z then Enter to save and exit
Check Expected Output

Expected: "1 file(s) copied" message; file created with your typed content

Task 9: View File Contents

Use the `type` command to display the contents of `welcome.txt` on your screen.

Command: type welcome.txt
Purpose: Displays the content of a text file
Check Expected Output

Expected: "Hello World" or whatever text you created in the file

Task 10: Rename, Move, and Copy

Rename `welcome.txt` to `greeting.txt`, move it into the Docs folder, and copy the entire Docs folder into Temp.

Rename: ren welcome.txt greeting.txt
Move: move greeting.txt Docs
Copy: xcopy Docs Temp
Check Expected Output

Expected: Each command executes successfully; verify file locations with `dir` in respective folders

Session 3 Cleanup & Advanced Control

Clean up your workspace and learn advanced command-line control techniques.

Task 11: Clear Screen

Use the `cls` command to clear your terminal window after completing the previous tasks.

Command: cls
Purpose: Clears the command prompt screen
Check Expected Output

Expected: Screen is cleared; only prompt remains at top

Task 12: Delete Files

Delete `mynotes.txt` using the `del` command. Safety Note: This removes files permanently (no Recycle Bin).

Command: del mynotes.txt
Warning: Files deleted with `del` are permanently removed
Check Expected Output

Expected: File is deleted; verify with `dir` to confirm it's gone

Task 13: Remove Directories

Remove the Temp folder using `rd` (rmdir). Note: Ensure the directory is empty first!

Command: rd Temp or rmdir Temp
Warning: Only works on empty directories; removes permanently
Check Expected Output

Expected: Directory is removed; verify with `dir` to confirm it's gone

Task 14: Start and Exit

Use `start` to open a new Command Prompt window or launch an application like notepad, then use `exit` to close your session.

Start: start notepad or start cmd
Exit: exit
Purpose: `start` opens new windows/apps; `exit` closes the current session
Check Expected Output

Expected: `start` opens new window/application; `exit` closes the command prompt

Ready to test your knowledge?

Take the Assessment →