Computer Hope

Microsoft => Microsoft DOS => Topic started by: farzi on September 11, 2007, 04:12:18 AM

Title: interact with the dos command output using a batch file
Post by: farzi on September 11, 2007, 04:12:18 AM
Hi

I will explain my problem with the command itself.
Whenever i give a command comp filename1 filename2

The out put is :

Comparing filename1 and filename2...
Files are different sizes.

Compare more files (Y/N) ?



I want to give a Y/N using batch file itself.How can this be done?
I am using:Microsoft Windows XP [Version 5.1.2600]
Title: Re: interact with the dos command output using a batch file
Post by: gpl on September 11, 2007, 04:33:28 AM
Try this
Echo N|comp filename1 filename2

The | symbol sends the output of the first command (Echo N) as input to the second (the Comp command)


Graham
Title: Re: interact with the dos command output using a batch file
Post by: farzi on September 11, 2007, 04:38:04 AM
Thanx a ton graham..
i dont know if this is the right solution ..but it is working great for me ..
thanks again ..