This is used to extract a substring via the position of the characters in the string.
@echo off set str = Helloworld echo %str% set str = %str:~5,10% echo %str%
The key thing to note about the above program is, ~5,10 is used to specify the characters which needs to be displayed. In this case, we want character 5 to 10 should be displayed.
The above command produces the following output.