Page 1 of 1

[unsolved] how2 expand replaceable character variables ?

Posted: 14 Apr 2008 19:59
by chrizoo
Hi. Does anybody know how Replaceable Character Variables can be expanded?

For example I can get the 5 left chars of %str% with: %str:~0,5%

But how can I do the same thing with %%a ?
Obviously %%a:~0,5 or %%:~0,5a ... etc., doesn't work...

Thanks a lot.

Posted: 18 Apr 2008 06:28
by jeb
Hi chrizoo,

in my opinion it is not possible to expand this type of variables.
But obviously you can copy them and then do the job.

SET aa=%%a
echo %aa:~0,5%

jeb