Disabling user prompting when using COMP (DOS) command within a BATCH file

I am comparing files from one directory to another using a batch file and i use the following code:

COMP C:\test\dira C:\test\dirb /L | find "different"
IF ERRORLEVEL 1 ECHO Files are identical
IF NOT ERRORLEVEL 1 GOTO COPYDIR

When i run the command it prompts the user if they would like to compare more files. I want the batch file to run withought prompting the user if they would like to compare anymore files.. if you like... force the command to use N (No)

zoomzoomdevelopersAsked:
Who is Participating?
 
RanjeetRainCommented:
Change that to:



ECHO N | COMP C:\test\dira C:\test\dirb /L | find "different"
IF ERRORLEVEL 1 ECHO Files are identical
IF NOT ERRORLEVEL 1 GOTO COPYDIR


Sorted!
0
 
zoomzoomdevelopersAuthor Commented:
Sweeter than a sweet thing!

Works a treat!

Thanks
0
 
RanjeetRainCommented:
Relish it ;)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.