Command Prompt Tutorial: Making a backup script #2 (using batch "subroutines")

Опубликовано: 25 Июль 2026
на канале: Alan Carre
1,488
0

As expected (or "usual" take your pick) instead of going straight to the answer, we follow a few diversions. But, no time wasted, many interesting things came up. In particular, the ability to create little subroutines inside a batch file. In our case, in looking for the current directory name we found that we could extract just the folder name using the trick of passing an environment string to a partial script or "sub-scrip" within the file. The reason being so that we can take advantage of the command processor's built-in "path parsing" mechanism which only works with passed-in arguments (as far as I know!).