echo batch variables

February 19, 2010 at 18:38:18
Specs: Windows 7
i was wondering if you could do somthing like this:
echo set quit= >> %saveas%.bat
echo set /p quit= >> %saveas%.bat
echo if %quit%==Q goto quit >> %saveas%.bat
echo if %quit%==E goto exit >> %saveas%.bat
echo :quit >> %saveas%.bat
echo exit >> %saveas%.bat
echo :exit >> %saveas%.bat
echo Call "Better word processor.bat" >>
so if anyone could help me that be great

See More: echo batch variables

Report •

February 19, 2010 at 19:03:24
yeah, but you need to double up all the % on the left side of any >> in the script, and you need to define value of %saveas%
set saveas=xxx.bat
echo if %%quit%%==Q goto quit >> %saveas%.bat
echo if %%quit%%==E goto exit >> %saveas%.bat

Report •

February 19, 2010 at 19:16:03
thx so much ive been over and over this for days

Report •

February 20, 2010 at 06:10:50
Some characters need (can use) the caret sign to prevent them from being interpreted too early, example:

D:\Temp>echo ^%PATH^%


... where omitting the caret sign (^) would just parse %PATH% directly and show content straight away.

Report •
Related Solutions

Ask Question