PC Review


Reply
Thread Tools Rate Thread

bat file: how to hide comp prompt

 
 
Benny
Guest
Posts: n/a
 
      13th Jun 2005
I use following code to get the return value of comp

....
@echo n|comp %1 %2 >nul
IF ERRORLEVEL 1 GOTO CPY
....

but it will prompt
"Compare more files (Y/N) ?"

How can i hide the message?

 
Reply With Quote
 
 
 
 
William Allen
Guest
Posts: n/a
 
      13th Jun 2005
"Benny" wrote in message
> I use following code to get the return value of comp
>
> ...
> @echo n|comp %1 %2 >nul
> IF ERRORLEVEL 1 GOTO CPY
> ...
>
> but it will prompt
> "Compare more files (Y/N) ?"

....snip

Try something along these lines:

@ECHO OFF
(ECHO/n&ECHO/n)|comp %1 %2 >NUL 2>&1
IF ERRORLEVEL GOTO CPY

That should send two "N" replies through the pipe to COMP
and 2>&1 should redirect both channels 2 and 1 to NUL and
may get rid of the COMP prompt.

--
William Allen
Free interactive Batch Course http://www.allenware.com/icsw/icswidx.htm
Batch Reference with examples http://www.allenware.com/icsw/icswref.htm
Header email is rarely checked. Contact us at http://www.allenware.com/


 
Reply With Quote
 
Benny
Guest
Posts: n/a
 
      14th Jun 2005
Thank you!
It works.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide the command prompt window when start a CMD file KL Wong Microsoft Windows 2000 Terminal Server Clients 0 5th Nov 2004 11:58 AM
misc.taxes,comp.dcom.wan,comp.graphics.api.opengl,comp.home.automation,comp.sys.ibm.pc.hardware.storage . Storage Devices 0 19th Jun 2004 09:01 AM
USB comp. A to USB comp B. file transfer? Larry Windows XP Hardware 1 12th Jun 2004 04:03 PM
Hide command prompt Microsoft Windows 2000 CMD Promt 6 15th May 2004 10:49 AM
hide command prompt window when running batch file ? scott Microsoft Windows 2000 3 19th Sep 2003 12:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:26 AM.