Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

"comp" Command In Batch File


  • Please log in to reply
3 replies to this topic

#1 PropagandaPanda

PropagandaPanda


  • Malware Response Team
  • 10,433 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:10:40 AM

Posted 24 May 2008 - 12:42 PM

Hello.

Is there any way to use the comp command in a batch script without it showing:
Compare more files (Y/N) ?
All I need is the errorlevel not the result to be displayed.

Alternatively, is there a similar command line program for comparing files that will set an errorlevel?

With Regards,
The Panda

O thanks for moving it. Didnt know this forum existed.

Edited by PropagandaPanda, 24 May 2008 - 12:59 PM.


BC AdBot (Login to Remove)

 


#2 Alan-LB

Alan-LB

  • Members
  • 71 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Junee, NSW, Australia
  • Local time:01:40 AM

Posted 24 May 2008 - 08:59 PM

I think you can redirect output to nul:

comp > nul:

This should stop all output from being displayed without affecting the errorlevel.

Alan.
There are 10 types of people - those who understand binary and those who don't!!

Today is the Beta version of Tomorrow!

#3 PropagandaPanda

PropagandaPanda

  • Topic Starter

  • Malware Response Team
  • 10,433 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:10:40 AM

Posted 25 May 2008 - 01:35 PM

Hello.

Thanks, that stops output of the result, but not the Y/N message :thumbsup:.

With Regards,
The Panda

#4 PropagandaPanda

PropagandaPanda

  • Topic Starter

  • Malware Response Team
  • 10,433 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:10:40 AM

Posted 25 May 2008 - 06:42 PM

Hello.

OK guys I got it figured out:).

echo n | COMP new.txt old.txt | FIND "Files compare OK" > nul

Will still display the message but skips over it.

With Regards,
The Panda




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users