|
Answer» Hi,
I have a batch FILE that executes a COMMAND. However when its done, my last line ECHO "FINISHED" doesn't display. What am I doing wrong?
Code: [Select]@echo off echo Hello this is a test batch file for PDF and FO production.
SET disp=cmd /k SET /P myval=Display Errors? [Y/N]
IF "%myval%"=="n" ( SET disp= )
%disp% FOP -xml c:/temp/testme2.xml -xsl c:/temp/test.xsl -pdf foo.pdf -d
ECHO FINSHEDIf I understand your question right, this should work. Just put 'pause' (w/o quotes) on the next line. If you want it to say Finished and not the original 'pause' message, type 'pause > nul' (w/o quotes).Yes, dragonmaster is right.
What is happening in your CURRENT batch file is that it echoes FINISHED, but then exits, because all the jobs are done. By adding the pause (preferably pause >nul), the file waits until any button is pressed before continuing (or this CASE, finishing).Thanks for the help.
I've added the following line and dos windows still closes after it executes:
ECHO FINSHED
pause
or
ECHO FINSHED
pause >nul
Not sure what I am missing... I believe that the program gets an error from this line: %disp% Fop -xml c:/temp/testme2.xml -xsl c:/temp/test.xsl -pdf foo.pdf -d
Because of the error, the batch file just shuts itself off, without attempting to reach the end. I would recommend trying that line by itself, and seeing if it works (and if it doesn't, see what's been done wrong).Thanks... you're are right.
it was "cmd /k" causing the problem.
Thanks Again Quote ECHO FINSHED That would make it echo "finshed" and not "finished"
|