I have a little problem in my code,
if I
set ghot=1
and
set fo1=text
and try echoing
echo %fo%ghot%%
like this, it comes like
%fo1%
instead of text
I have a little problem in my code,
if I
set ghot=1
and
set fo1=text
and try echoing
echo %fo%ghot%%
like this, it comes like
%fo1%
instead of text
I misunderstood what you were asking at first. Adding call to the line will give you the behavior you want.
call echo %%fo%ghot%%%
Edited to add the extra enclosing %'s It works without them from the command line, but not from within a batch file.
An alternative method using delayed expansion:
@Echo Off
SetLocal EnableDelayedExpansion
Set "ghot=1"
Set "fo1=text"
Echo=!fo%ghot%!
Timeout -1