1.

Solve : Special Char?

Answer»

how can i set all char ([emailprotected]#$%^&*()_+}{"|:<>?/.,\';][=-) to a each other variable and then echo them??
i've tryied this:
Code: [Select]C:\Users\Vaio>set a=&
C:\Users\Vaio>echo %a%
%a%
C:\Users\Vaio>set a=^&
C:\Users\Vaio>echo %a%
ECHO is on.
C:\Users\Vaio>set a=!
C:\Users\Vaio>echo %a%
!and in for LOOP. No one of them was working.
Does any body know ?


Most of those characters have to be escaped, like your 2nd SET command. Some of them also have special MEANING in the command prompt, so they would need to be quoted or escaped or combined with other characters. TRY this:

Code: [Select]set a=^&
echo "%a%"
echo ^%a%OK but how to:
Code: [Select]set a=^&
set m=%m%^%a%
echo %m%
it doesnt WORK at allQuote from: devcom on July 29, 2008, 06:09:04 AM

ok but how to:
Code: [Select]set a=^&
set m=%m%^%a%
echo %m%
it doesnt work at all

It does work but you omitted to escape the echo line i.e. echo ^%m%

no it doesnt, i have vista and this may be a problem
Code: [Select]C:\Users\Vaio>set a=^&
C:\Users\Vaio>set m=%m%^%a%
C:\Users\Vaio>echo ^%m%
%m%
C:\Users\Vaio>echo %m%
%m%
C:\Users\Vaio>echo %a%
ECHO is on.
C:\Users\Vaio>echo ^%a%
&
and i would repeat this commandCode: [Select]set m=%m%^%a%100 times, so %m% must look like hudert of '&' (just example)


Discussion

No Comment Found