"Benny" wrote in message
> I use following code to get the return value of comp
>
> ...
> @echo n|comp %1 %2 >nul
> IF ERRORLEVEL 1 GOTO CPY
> ...
>
> but it will prompt
> "Compare more files (Y/N) ?"
....snip
Try something along these lines:
@ECHO OFF
(ECHO/n&ECHO/n)|comp %1 %2 >NUL 2>&1
IF ERRORLEVEL GOTO CPY
That should send two "N" replies through the pipe to COMP
and 2>&1 should redirect both channels 2 and 1 to NUL and
may get rid of the COMP prompt.
--
William Allen
Free interactive Batch Course
http://www.allenware.com/icsw/icswidx.htm
Batch Reference with examples
http://www.allenware.com/icsw/icswref.htm
Header email is rarely checked. Contact us at
http://www.allenware.com/