1.

Solve : Calling Batch file not shows echo message?

Answer»

Hi,

I have Parent file DEL_FOLDER.BAT which call Del_archive.bat file .

Batch file Del_archive.bat CONTAIN a question for user to delete or not the archive file like

SET /P Option=Do you REALLY want to delete all previous month Backup folders (Y/N)=: -^>
IF NOT '%Option%'=='' SET Option='%Option%'


if %Option%=='Y' goto :menu1
if %Option%=='y' goto :menu1
if %Option%=='N' goto :menu2
if %Option%=='n' goto :menu2
echo "%Option%" is not valid choice then try again......
goto :menu4


but when I tried to ran DEL_FOLDER.BAT parent file then the question from child file doesn't appear on screen.
CODE for DEL_FOLDER.BAT
CALL Del_archive >%LOG_FIL%


What is missing in the code?Quote

code for DEL_FOLDER.BAT
CALL Del_archive >%LOG_FIL%

You are calling Del_archive and redirecting output to %LOG-FIL% so the Set /p command in Del_archive writes the question to %LOG_FIL% instead of the screen where you expect to view it.

What kind of file is %LOG_FIL%. If it's text I could GIVE you some code to show the contents of %LOG_FIL% on the screen.Quote from: BatchFileCommand on August 15, 2009, 12:35:06 PM
What kind of file is %LOG_FIL%. If it's text

I think that is pretty certain, given that it is the output of a batch file.


Discussion

No Comment Found