• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 524
  • Last Modified:

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)

0
zoomzoomdevelopers
Asked:
zoomzoomdevelopers
  • 2
1 Solution
 
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now