Click here for important information about

batch react to program output?

Microsoft Windows vista ultimate 64-bit
January 10, 2010 at 16:41:00
Specs: Windows Vista
can i have a batch file react to an output from a DOS program?

for example, a DOS program run in the batch is comparing two files. if they match it gives a specific text output on screen, and if they dont match it lists the offsets that are different on screen.

can a batch recognise the "they match" text and move to a given command, or if it lists differences then move to a different command?

See More: batch react to program output?

January 10, 2010 at 17:27:34
If it sets an errorlevel, like good 'ol FC, you can use that.

If not, you'll have to work with the output verbage.
@echo off & setLocal EnableDELAYedeXpansion

fc one two > nul
goto :!errorlevel!
echo same & goto :eof
echo not same

Helping others achieve escape felicity


Report •

January 10, 2010 at 18:28:45
that sounds like almost what i'm after, the command itself is;

fc 1.bin 2.bin /b

Report •

January 12, 2010 at 04:01:25
just as a follow up, using errorlevel worked a treat!

many thanks ;)

Report •
Related Solutions

Ask Question