The Book of Batch Scripting: From Fundamentals to Advanced Automation
- 9h 15m
- Jack McLarney
- No Starch Press
- 2024
In this era of advanced programming languages, the simplicity, universality, and efficiency of Batch scripting holds undeniable value.
Whether you’re maintaining legacy systems or seeking to understand the foundations of command line automation, The Book of Batch Scripting shows you how to become proficient with this tool included in every version of Windows.
As you work through the book, you will:
- Write a simple .bat file that performs a daily task with just a couple of mouse clicks
- Delve into variables and data types, and learn how a variable can possess two values at once—and why you should care
- Learn how to manage and collect data on files and directories either locally or on a network
- Harness the power of the for command to build complex loops with just a few lines of code
- Explore advanced topics like recursion, performing text searches, and even learn how to write a .bat file that writes a .bat file
- Extend Batch to use features like booleans, floats, operators, arrays, hash tables, stacks, queues, and even object-oriented design
Written for beginners and experts alike, The Book of Batch Scripting will have you streamlining your workflow and writing effective code in no time. This simple but powerful tool is about to make your life a little bit easier and more fun.
About the Author
Jack McLarney has been coding professionally since 1999 at companies like Protective Life Corporation, Fiserv, and The Hartford Financial Services Group. McLarney teaches part-time at Manchester Community College as an Adjunct Professor of Mathematics and holds an MS in Applied Mathematics from the University of Connecticut.
In this Book
-
Introduction
-
Batch
-
Variables and Values
-
Scope and Delayed Expansion
-
Conditional Execution
-
String and Boolean Data Types
-
Integer and Float Data Types
-
Working with Files
-
Executing Compiled Programs
-
Labels and Nonsequential Execution
-
Calling Routines and Bat Files
-
Parameters and Arguments
-
Outputs, Redirection, and Piping
-
Working with Directories
-
Escaping
-
Interactive Batch
-
Code Blocks
-
Fundamentals of the for Command
-
Directories, Recursion, and Iterative Loops
-
Reading Files and Other Inputs
-
Advanced for Techniques
-
Pseudo-Environment Variables
-
Writing Reports
-
Recursion
-
Text String Searches
-
Bat Files Building Bat Files
-
Automatic Restarts and Multithreading
-
And/Or Operators
-
Compact Conditional Execution
-
Arrays and Hash Tables
-
Odds and Ends
-
Troubleshooting Tips and Testing Techniques
-
Object-Oriented Design
-
Stacks, Queues, and Real-World Objects
-
Afterword
-
A Fully Functional Batch Improv
-
B Array and Hash Table Objects