"Synapse Syndrome [KGB]" <***@NOSPAMsyndrome.me.uk> wrote in message news:***@TK2MSFTNGP06.phx.gbl...
<snip>
Thanks, with that keyword 'substring', I found this page which describes
http://www.ss64.com/nt/syntax-substring.html
The concept of "substring" (sometimes called "midstring") is used
extensively in most programming languages. It is often complemented by the
"leftstring" and "rightstring" functions, both of which are available under
the Windows Command Processor. Type for /? to see how it's done. Note that
the syntax for these functions under the Command Processor is unbelievably
cryptic. In most programming languages it is far simpler, e.g.
x = mid(Name, 3, 5)
y = left(Name, 2)
z = right(Name, 9)
I suppose you mean ENDLOCAL, and SETX for permanent changes?
When you run a batch file such as
@echo off
set Name=ss
then the variable %Name% remains set within the current Command Processor.
When you modify this batch file like so:
@echo off
setlocal
set Name=ss
endlocal
then the variable %Name% is lost the moment the batch file ends. In either
case the variable is lost when the current Command Processor is closed. To
prevent this, you can use setx.exe. I recommend you test these concepts in
order to become comfortable with them.