Getting a Substring Out of Batch
One of my friends, Andrew from Vancouver, sent me this extremely useful tip about how to grab a sub-string via BATCH.
<snip>
here’s a CMD shell tip that works in W2K, WXP, and W2K3.
There is a BASIC MIDSTR function equivalent in batch files… use this syntax as a modifer:
~:start,end
e.g.
set foo=\\servername
@echo unretouched [%foo%]
@echo modified [%foo:~2,99%]
will output:
unretouched [\\servername]
modified [...]
