Batch Scripting Cheat Sheet

Posted : admin On 1/29/2022
  • Batch Script Tutorial

All postional arguments (as a single word) [email protected] All postitional arguments (as separate strings) $1. Last argument of the previous command. Note: [email protected] and $. must be quoted in order to perform as described. Otherwise, they do exactly the same thing (arguments as separate strings).

Get the path and file name of the currently running batch file. There are other commands to get more file information, but to me the most important ones are these:%dp0 outputs the path of the current batch file%nx0 outputs the name of the current batch file; To see it in action, put this into a batch file. Used from the DOS prompt or in a batch file or in the CONFIG.SYS file to set (or display) whether or not DOS should check for a Ctrl + Break key combination. BUFFERS: BUFFERS=(number),(read-ahead number) Used in the CONFIG.SYS file to set the number of disk buffers (number) that will be available for use during data input. A Performance Cheat Sheet for PostgreSQL: Great explanations of EXPLAIN, EXPLAIN ANALYZE, VACUUM, configuration parameters and more. Quite interesting if you need to tune-up a postgres setup. Psql -c ' l+' -H -q postgres out.html: Generate a html report of your databases (source: Daniel Westermann).

Batch Scripting Cheat Sheet

  • Batch Script Resources

Batch Scripting Cheat Sheet Template

Scripting

Batch File Commands Cheat Sheet

  • Selected Reading

Batch Scripts are stored in simple text files containing lines with commands that get executed in sequence, one after the other. Scripting is a way by which one can alleviate this necessity by automating these command sequences in order to make one’s life at the shell easier and more productive. This tutorial discusses the basic functionalities of Batch Script along with relevant examples for easy understanding.

This tutorial has been prepared for beginners to understand the basic concepts of Batch Script.

A reasonable knowledge of computer programming and concepts such as variables, commands, syntax, etc. is desired.