Basic batch script commands

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!


  1. @echo off - This command hides the command prompt’s execution details. It keeps the commands running in the background.

  2. echo - Displays a line of text in the terminal. For example: echo Welcome to Sam's Clubs Batch Script.

  3. cls - Clears the terminal screen.

  4. pause - Stops the script and waits for the user to press Enter to continue.

  5. : - 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.

  6. goto - Directs the script to go back to a specified tag and repeat the commands from there. For example: goto welcome.

  7. adb wait-for-device - Pauses the script until an ADB-connected device is detected. This is particularly useful for scripts running ADB commands.

  8. 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. :stuck_out_tongue_winking_eye:

3 Likes