Computing.Net > Forums > Disk Operating System > DOS copy without echoing on the screen

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

DOS copy without echoing on the screen

Reply to Message Icon

Name: RC
Date: April 14, 2002 at 06:36:29 Pacific
Comment:

In my DOS batch file the "copy" command is used to copy the contents of one folder to another folder. I have @echo off
set at the beginning of the file, but when
the files are copied, the results are displayed on the screen. How can I NOT display on screen all the files that are being copied?



Sponsored Link
Ads by Google

Response Number 1
Name: the compter expert
Date: April 14, 2002 at 07:01:34 Pacific
Reply:

> nul
on the end of the copy command line will do what you want.

i.e.
copy autoexec.bat a:\ > nul


0

Response Number 2
Name: Andrés
Date: April 14, 2002 at 12:11:17 Pacific
Reply:

"echo off" tells DOS not to show on screen each of the commands executed in your batch file, which is different. It is used to replace, all in one command, the "@" in front of each command, which does the same. One "@echo off" (with the @ to hide even that line) hides all commands. What you can do to make programs not to show anything on screen is to redirect them to the null device, that's what the other fellow said.
Also, if it doesn't work, you can try running CTTY NUL, then the command, then CTTY CON.

Andrés


0

Response Number 3
Name: Secret_Dooom
Date: April 14, 2002 at 19:41:00 Pacific
Reply:

In addition to what was said in previous answers:

The method with CTTY also supress error messages, like "file not found". The method presented by "the computer expert" does NOT supress error messages.

copy file1.dat file2.dat > nul

If, for instance, doesn't exist, an error message WILL be displayed. But:

CTTY NUL
copy file1.dat file2.dat
CTTY CON

That will supress any error messages.

DO NOT FORGET TO GIVE "CTTY CON"!!! If you end the batch file without passing that command, user won't be able to gain control of the computer.

PS: What sort of nickname is "the comptuter expert"? Wow, he must be really "VERY" expert...........

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 4
Name: RC
Date: April 17, 2002 at 19:06:26 Pacific
Reply:

You guys Rock !!
Thank you, thank you, thank you.

Thanks, Leonardo, Andres and Compter Expert

I learned something from each of you.

I had given up on this problem, but I took your advice and it worked great.

ps. Nice website at www.batch.hpg.com.br
I will tell others about it. I know it will be very helpful.

Sincerely, RC


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Disk image conversion disk I/O error



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: DOS copy without echoing on the screen

Small crars on the screen. www.computing.net/answers/dos/small-crars-on-the-screen/16668.html

Pirating software help. www.computing.net/answers/dos/pirating-software-help/4468.html

Send info to screen and log file www.computing.net/answers/dos/send-info-to-screen-and-log-file/9374.html