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

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

DOS copy without echoing on the screen

Reply to Message Icon

Original Message
Name: RC
Date: April 14, 2002 at 06:36:29 Pacific
Subject: DOS copy without echoing on the screen
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?


Report Offensive Message For Removal


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


Report Offensive Follow Up For Removal

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


Report Offensive Follow Up For Removal

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


Report Offensive Follow Up For Removal

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


Report Offensive Follow Up For Removal







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



Results for: DOS copy without echoing on the screen

Small crars on the screen.
    Summary: Hi all guy´s. I want to do the characters of the DOS apears smaller than normal, like when you press the alt+F9 on the Norton Commander, or load edit /h. Is it possible? How can I do this?.In thia wa...
www.computing.net/answers/dos/small-crars-on-the-screen/16668.html

Pirating software help.
    Summary: I appreciate your vote of confidence DoOMsdAY, but I almost didn't look at this thread. Here is an ASCII assembler batch courtesy of Herbert Kleebauer. Watch carefully for wrapped lines and/or extra s...
www.computing.net/answers/dos/pirating-software-help/4468.html

Send info to screen and log file
    Summary: If I understand what you're trrying to do, I think this will do it: In your batch file, place an "echo off" statement at the beginning. For the lines you do not want shown on the screen, precede the...
www.computing.net/answers/dos/send-info-to-screen-and-log-file/9374.html






Which MP3 player do you have?

iPod/iPhone
Zune
Something Else
None


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History






Data Recovery Software