Batch file coding engine

October 3, 2011 at 13:09:08
Specs: Windows XP
I want to make a coding engine in a batch file. depending on what it says, it will do a certain command, but instead of using it directly to a batch file, I want it to copy to a text file. Example:

@echo off
color 0f
title DrexCode -(CRNT{file[10.590125782_05]beta}raw)-
echo Welcome %logname% to DrexCode10!
echo DrexCode makes it easy to write programs just like DoSa!
echo ---------------------------------------------------------
echo What are you going to make? (1)Program (2)Ai (3)Write in BATCH (4)How To use DrexCode:
set /p t=
if %t%==1 goto prog
if %t%==2 goto ai
if %t%==3 goto bat
if %t%==4 goto how

set /p title=TITLE OF PROJECT:
set /p p=MNSTRM_CMD:
if %p%==display.function_browser goto browser
if %p%==display.function_type goto type
if %p%==display.function_AI goto ai
if %p%==display.function_goldbus goto goldbus

set /p title=TITLE OF PROJECT:
set /p ai=MNSTRM_CMD:
if %ai%==on(enter_comment)function_true=display.function_RAND goto rand
if %ai%==if(funct)="What_is_the=time"=display.function_time goto time
if %ai%==if(funct)="What_is_the_date"=display.function_date goto date
if %ai%==if(funct)="What_is_your_name"=display.function_ai(name) goto name

@echo off >>%name%.bat
color 0a >>%name%.bat

But when I try, it only pastes half ofe the code, and it wont allow sings like % etc
Please help

-Thank you

See More: Batch file coding engine

Report •

October 7, 2011 at 05:43:48
First off, I'm guessing you know that the script, as written, doesn't really do anything? Because I'm not sure what you're trying to accomplish.

That being said, if you want to output certain symbols to another file, regardless of whether its extension is .bat or .txt, you have to escape them. The escape character in batch is a carat, and you have to do double percents.

For instance, this:

>test.bat echo type test.txt ^| find /i "50%%" ^&^& echo :^)

Would output this to test.bat:

echo type test.txt | find /i "50%" && echo :)

Hope that helps. =)

Report •
Related Solutions

Ask Question