Everyone who likes to use variables and work with arguments is familiar with these possibilities and likes to benefit from the advantages under all operating systems and not only under Microsoft Windows 11/10 and MS Server OS!
1.) Command line arguments in the command prompt!
Batch Scripts / Command Prompts support command line arguments where arguments can be passed to the batch file when invoked. The arguments can be called from the batch files via the variables %1,%2,%3, ... etc.
@echo off
echo %1
echo %2
echo %3
pause
If the above batch script is saved in a file called test.bat and execute the batch, for example via a Windows shortcut and use arguments!
Test.bat one two three
When the batch file is executed, these values can be output
3.) Local and global variables, understand the difference!
In every programming language there is an option to mark variables with a range, that is, the section of code that can be accessed. Typically, variables with a global scope can be accessed anywhere from a program, while variables with a local scope have a defined limit at which they can be accessed.
It is easy to rename files in batches using a script or command prompt in lower and / or upper-case letters on Windows 11, 10, and MS Server OS Everyone