Skip to contentSkip to conversation

To compare to files in dos

DISCUSSION Dos_Neo 2 participants 2 messages Nov 21, 2008

lore
Share & tools
lore

Dos_Neo

author
#0 lore raw

Hi All,

I want to compare to 2 file(.txt) in dos prompt. suppose i have files- output1.txt and output2.txt in d:\ drive

If i compare this two files i want some output
===============================================
if they match result should be "They matach"
if not matach then "They do not matach"

Signature · 2 lines
View this message in context: http://www.nabble.com/To-compare-to-files-in-dos-tp20627871p20627871.html
Sent from the linux-msdos mailing list archive at Nabble.com.
#1 lore raw
Quoted 7 lines · On Fri, 21 Nov 2008 11:19:05 -0800 (PST) Dos_Neo <[email protected]> wrote:

I want to compare to 2 file(.txt) in dos prompt. suppose i have files- output1.txt and output2.txt in d:\ drive

If i compare this two files i want some output
===============================================
if they match result should be "They matach"
if not matach then "They do not matach"

You can easily do this with a small batch file and the cmp command.

cmp will provide you with an errorlevel that you can check and print anything you want from your batch file.

Signature · 2 lines
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
DRY CLEANER BUSINESS FOR SALE ~ http://www.canadadrycleanerforsale.com