If you don’t know what a batch script is or don’t know how to create one then check this out
I know most people might not need this. Below is a very basic guide on some essential batch script commands and their explanations. I hope this helps!
-
@echo off
- This command hides the command prompt’s execution details. It keeps the commands running in the background. -
echo
- Displays a line of text in the terminal. For example:echo Welcome to Sam's Clubs Batch Script
. -
cls
- Clears the terminal screen. -
pause
- Stops the script and waits for the user to press Enter to continue. -
:
- Tags a section of commands. It’s like a bookmark to help keep you organized and will be useful with other commands later on. For example::welcome
. -
goto
- Directs the script to go back to a specified tag and repeat the commands from there. For example:goto welcome
. -
adb wait-for-device
- Pauses the script until an ADB-connected device is detected. This is particularly useful for scripts running ADB commands. -
timeout /t <1>
- Pauses the batch script for a specified number of seconds. You can modify the pause duration by changing the number, for example:timeout /t 5
pauses the script for 5 seconds.
Please feel free to edit this post and add any other commands I might have missed (there are plenty but I just don’t know them or couldn’t explain it well). Also, correct any mistakes. I hope this is helpful to some people!
If you found this useful, please give a like.