CMD Master
Back to Blog
Arnošt Havelka

Practical: System Audit

Scripting a professional system inventory report.

Start Interactive Lesson
Practical: System Audit

As a Sysadmin, your boss wants a report on a workstation's status. Instead of running commandsmanually, let's write a batch script to generate a professional report automatically.

The Mission

Create audit.bat that:

  1. Grabs the Hostname.
  2. Grabs the IP Address.
  3. Grabs the Running Processes.
  4. Saves it all to report.txt.

Step 1: The Script Structure

We will use echo to create headers and redirection >> to compile the file.

Terminal
C:\Users\Student>copy con audit.bat

Step 2: Running the Audit

Execute the script.

Terminal
C:\Users\Student>audit.bat

Step 3: Viewing the Report

Let's see what we generated.

Terminal
C:\Users\Student>type report.txt

Knowledge Check

1 / 2

Why do we use '>>' instead of '>' for the second command?

References

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

Up Next

Power Features

Master powercfg workflows for battery diagnostics, sleep policies, and reliable recovery actions.