[unsolved] how2 expand replaceable character variables ?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
chrizoo
Posts: 1
Joined: 14 Apr 2008 19:50

[unsolved] how2 expand replaceable character variables ?

#1 Post by chrizoo » 14 Apr 2008 19:59

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.

jeb
Expert
Posts: 1041
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

#2 Post by jeb » 18 Apr 2008 06:28

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

Post Reply