
Unlock batch scripting basics by learning essential commands, special characters, decision making, arrays, and functions in the Windows command prompt to build confidence for beginners.
Explore batch scripting basics by choosing a code editor, with Notepad++ recommended, or use Notepad, Visual Studio Code, or Sublime Text, all downloadable from official websites.
Discover how batch files automate tasks by writing a script in Notepad or Notepad++, using echo and pause, and saving with .bat or .cmd to create your batch file.
Double-click a batch file to run it and see hello printed in the console, or execute it from the command prompt by navigating to the batch file's directory on the desktop.
Learn batch scripting basics by using echo to print text, handle quotes, and control command output with echo on, echo off, and at the rate, then create and run test.bat.
Use the cd command to navigate directories and display the current batch file directory. Verify that cd with no parameters shows the batch file's current directory, such as desktop.
Explore the verbatch command to display the operating system version number with a practical, hands-on example. Update a script file, save, execute, and observe the version output in the terminal.
Learn how the dir command lists directory files and subdirectories, showing volume label, serial number, names, dates, sizes, totals, and free space, with help via dir /?
Learn how to use the dir command with /a to display hidden and system files, and combine h with a to show only hidden files in batch scripts.
Learn how to list .txt files with the dir command, using an asterisk as a wildcard to end with .txt, then filter and verify results on the desktop.
Learn to use the pause-batch command to hold the console until a key is pressed, with an example printing hello there and the press any key to continue message.
Master batch scripting basics by copying 8.txt from the desktop into testb and testa, handling spaces in paths with quotes and defining source and destination.
Copy .txt files from the test folder to testp using a wildcard and explicit extension, then execute the script and verify four files were copied into testp.
Copy all contents from the test folder into the testb folder using the copy command; note that directories are not copied. Learn how xcopy overcomes this limitation to include directories.
Master the xcopy batch command to copy files and directory trees, using slash s to include subdirectories and exclude empty ones and slash e to include empty directories.
Discover how to use the delbatch command to delete one or more files, specify a path, run the script, and verify that a.txt is removed—remember you can't retrieve it.
Learn to delete files with the del command and a confirmation prompt using the /p switch. See how the script prompts for deletion of c.txt and records yes or no.
Master batch scripting basics by using the del command with a wildcard to delete .rtf files in a testb folder, demonstrating verification of deletion.
Learn how to delete all files in a folder using a batch script by copying the path, updating the script, executing it, and confirming deletion.
Learn to delete all files in a folder with spaces by wrapping the full path in double quotes, update the script, run it, and confirm deletion in ztesta.
Learn to use the move batch command to move files across directories, rename directories, and relocate directories, with a practical example moving a.txt into the testb folder.
Use the move command to rename a directory by updating the script with the source and destination paths, rename testb to testbcde, and verify the change.
Learn about special characters in batch scripting, including the at symbol to hide command while showing only the command output, and using echo off to display output like hello there.
Discover how the double colon, or scope resolution operator, acts as a label and command; run a script to print hello there, and use a trailing caret to suppress output.
Redirects command output to a file or to a null device using the redirect corrector; see an echo example that writes hello there to file.txt on the desktop.
Explore redirecting echo output to file.txt, learn how overwrite clears data, and apply the append special character to keep old data while adding new.
Use the append character to add command output to a file without overwriting existing data, and verify that new results are appended to file.txt.
Learn how batch scripts handle variables and command line arguments, using %1 and %2, and echoing them to the console, while noting a third argument is ignored.
Define variables with the set command, assign values without data types, and print them using echo with percent signs, as shown by the hello there example.
Learn that batch variable names and commands are not case sensitive, while variable content can be case sensitive, demonstrated by printing hello there to the console.
Learn how extra spaces around batch script variables affect expansion, as space placement can produce no output, a leading space, or the printed value, with echo behavior guiding the results.
Define a numeric variable in batch scripting using the /a switch, demonstrating how to store a 32-bit integer and print 20 to the console.
Learn practical debugging techniques for bash scripts using the echo command to inspect variables, track line execution, and identify where errors arise.
Update the script to trigger an error by assigning a value to an undeclared variable, observe the syntax error, and learn how pause aids debugging by keeping the window open.
Learn how to debug batch scripts by logging errors to a file with the toRedirectOperator, capturing output in error.txt from test.bad during script execution.
Learn how to debug batch scripts using the ErrorLevel environment variable, interpret 0, 1, 2 exit codes, and print there is error in your script with a check and pause.
Master decision making in batch scripting by using if conditions to test variables and execute code in the if block, demonstrated with a and b testing 12 and 10.
Learn how to use if conditions with command line arguments in batch scripting, define two variables, and validate their values with output like 'the value is correct' for each.
Master batch scripting basics by testing variables and case sensitivity. See how batch commands are not case sensitive, but variable content determines the output.
Demonstrate how the if else condition evaluates a test, executes the if or else block, and highlights case sensitivity with string comparisons in batch scripting.
Demonstrate how to use the if defined statement to test a variable's existence in batch scripting, printing 'variable is present' or 'variable is not present' based on the result.
Explore batch scripting operators and arithmetic operations, including addition, subtraction, multiplication, division, and modulus, by defining variables, performing calculations, and printing results.
Explore relation operators in batch scripting: equal to, not equal to, less than, less than or equal to, greater than, and greater than equal to.
learn to replicate logical operators in batch scripting using nested if conditions, demonstrating and/or behavior with variables and conditional echoes when both conditions hold or one fails.
Learn to replicate the logical or operator in batch scripting using multiple if conditions and defined checks to print whether the variable is present or not present.
Master the logical not operator in batch scripting by using if not to invert conditions, showing when echo executed prints for a variable value of 1 and suppresses for 10.
Master assignment operators in batch scripting, including addition, subtraction, and multiplication. See examples using a += 2, a -= 2, and a *= 2, producing 4, 2, and 4.
Master for loop usage in batch scripting by declaring variables with %% and a single character; run commands conditionally across single or multiple values with parameters auto-assigned in alphabetical order.
Demonstrates a batch scripting for loop by declaring a single-character variable, iterating over a list of values, printing them to the console, and observing iterations as the list shortens.
learn to loop through ranges using for /l, specify start, increment, and end, and print values from 0 to 5 to the console.
Learn to loop through folders with the for command using /d and wildcards, listing and processing folders like test one and test two.
Master batch scripting by looping through recursive folders with for /r, defining a path and a variable, and applying a set of files to the do statement.
Learn to create and access arrays in batch scripting using set to define elements and a for loop to iterate, referencing the index like a of zero.
Learn to access batch array elements by index using square brackets and the echo command, understand zero-based indexing, and retrieve values at positions zero and one.
Modify an array in batch scripting by using set to add an element at the last index, then update an index and print the result to the console.
Learn how to iterate over an array in batch scripting using a for loop, with setlocal and enable delayed expansion to print array elements to the console.
Define and use functions in batch scripting by declaring and defining them. Call functions with the call command and a function name to perform a specific task.
Learn how to use the call command to invoke a batch program or subroutine from another, with execution time variable expansion and a practical label display example.
Batch scripting is a simple and useful way to automate tasks on Windows using basic commands. A batch file is just a text file that contains a list of commands, and Windows runs them one after another. With batch scripting, you can save time by automating everyday tasks instead of doing them manually.
This course is designed especially for beginners who want to learn Batch scripting from scratch. No prior scripting or programming experience is required. Everything is explained in a clear and easy step-by-step manner, making it simple to follow and understand.
In this course, you will:
Learn what Batch scripting is and how it works
Understand basic commands used in Batch files
Learn how to create and run your own Batch scripts
Build confidence to continue learning more advanced scripting
The focus of this course is simplicity and practical learning. Each concept is taught in an easy way so that beginners can learn without confusion or fear of scripting.
Don’t wait for others to tell you which skills to learn.
Understand today’s needs, keep up with modern technology, and take your first step into automation.
I’m a professional instructor who has helped thousands of students learn Batch scripting. Join the course and enjoy learning this useful and beginner-friendly skill.