Problem creating a batch file with a mother-batch file
Posted: 17 Mar 2019 12:05
Hi programmers,
I encountered the following problem: I wanted to create a batch file able to create another batch file, here's the code:
Everything went ok until I realised that the output batch code was the following:
It missed the "%input%" script... how can I solve it? Thanks everyone
I encountered the following problem: I wanted to create a batch file able to create another batch file, here's the code:
Code: Select all
echo @ECHO OFF >> BulBot.bat
echo title BulBot >> BulBot.bat
echo color 70 >> BulBot.bat
echo :masterlabel >> BulBot.bat
echo set /P input= >> BulBot.bat
echo IF %input% EQU clear ( >> BulBot.bat
echo CLS >> BulBot.bat
echo ) >> BulBot.bat
echo IF %input% EQU readme ( >> BulBot.bat
echo start C:\BulBot\readme.txt >> BulBot.bat
echo ) >> BulBot.bat
echo goto masterlabel >> BulBot.bat
Code: Select all
@ECHO OFF
title BulBot
color 70
:masterlabel
set /P input=
IF EQU clear (
CLS
)
IF EQU readme (
start C:\BulBot\readme.txt
)
goto masterlabel