Inserting string into a variable.

Oct 24, 2011
73
1
I'm trying to insert "new-" at the beginning of a filename that was read for the command line into a variable. Why doesn't this work (and no insults please :))
set filmname=%$
set newfilename=%@insert[0,new-,%filename]
 
May 20, 2008
12,173
133
Syracuse, NY, USA
It seems to work here. Is there anything peculiar about the filename? You have used "filmname" and "filename" ... ?

Code:
v:\> type prefix.btm
set name=%$
set newname=%@insert[0,new-,%name]
echo %newname

v:\> prefix.btm foo
new-foo
 
Oct 24, 2011
73
1
Oh, thanks. I just realized there was a spelling error in my code. My 80-year-old eyes didn't notice it. Thanks.
 

samintz

Scott Mintz
May 20, 2008
1,557
26
Solon, OH, USA
If all you are doing is pre-pending why do you need @insert?
can't you do set newname=new-%filename
 

Similar threads