Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to suppress "1 files(s) copied" when copying?

14,511 views
Skip to first unread message

Dennis Halver

unread,
Apr 11, 2010, 12:04:42 PM4/11/10
to
In a batch file under WinXP I use some commands like:

@copy file1 file2

When I run the batch file then at the command prompt window for this statement always a line appears:

1 file(s) copied.

How can I suppress this info line?

Dennis

Timo Salmi

unread,
Apr 11, 2010, 12:14:23 PM4/11/10
to
On 11.04.2010 19:04 Dennis Halver wrote:
> @copy file1 file2
> When I run the batch file then at the command prompt window for this statement always a line appears:
> 1 file(s) copied.
> How can I suppress this info line?

http://www.netikka.net/tsneti/info/tscmd.php#nul

All the best, Timo

--
Prof. Timo Salmi mailto:t...@uwasa.fi ftp & http://garbo.uwasa.fi/
Home page: http://www.uwasa.fi/laskentatoimi/henkilokunta/salmitimo/
Department of Accounting and Finance, University of Vaasa, Finland
Timo's FAQ materials at http://lipas.uwasa.fi/~ts/http/tsfaq.html

ten.n...@virgin.net

unread,
Apr 11, 2010, 12:23:18 PM4/11/10
to

@COPY SOURCE [DESTINATION] >NUL

Sjouke Burry

unread,
Apr 11, 2010, 12:45:09 PM4/11/10
to

copy a b >nul

Tim Meddick

unread,
Apr 11, 2010, 3:07:22 PM4/11/10
to
Re-direct the output of the command-line you want to suppress to the "nul" file.

i.e. ;

copy foo.txt x:\path\filename.ext >nul


==

Cheers, Tim Meddick, Peckham, London. :-)


"Dennis Halver" <ha...@persrec.com> wrote in message
news:4bc1f319$0$6987$9b4e...@newsspool4.arcor-online.net...

Andrew

unread,
Apr 11, 2010, 3:08:36 PM4/11/10
to

this works

@copy file1 file2>NUL


>NUL kills the echo to screen


Andrew

jya...@peoplepc.com

unread,
Apr 11, 2010, 3:45:10 PM4/11/10
to

============================

copy filea fileb > nul will suppress it.

CAUTION - It will also suppress all result info! For instance, if the file
to copy doesn't exist you won't see an error.

alexsupra

unread,
Apr 11, 2010, 7:12:23 PM4/11/10
to

::medthod1
@echo off
copy file1 file2 >nul
::but operation results will be lost
::and this method is not universal cause not the all versions of nt
have the null driver (like server or legacy)

::method2
@echo off
copy file1 file2 >>filecopy.log
::in this case operation results are saved in log file and its more
universal

::method3
nircmd.exe execmd copy file1 file2
::and thats alternative silent method but requires this console tool:
http://www.nirsoft.net/utils/nircmd.html

John Gray

unread,
Apr 12, 2010, 1:25:22 AM4/12/10
to
On 12 Apr, 00:12, alexsupra <alexsu...@gmail.com> wrote:
<snip>

> @echo off
> copy file1 file2 >nul
> ::but operation results will be lost
> ::and this method is not universal cause not the all versions of nt
> have the null driver (like server or legacy)

Where do you get this idea from? I've used the '> nul' format
successfully in all the versions of Windows Server I've used from NT
3.51 to Windows Server 2008!

foxidrive

unread,
Apr 12, 2010, 2:12:29 AM4/12/10
to
On Sun, 11 Apr 2010 22:25:22 -0700 (PDT), John Gray <gga...@emailias.com>
wrote:

I agree, the NUL device is in every Microsoft OS AFAIK.


--
Regards,
Mic

alexsupra

unread,
Apr 12, 2010, 5:37:36 AM4/12/10
to

NUL device driver actually doesnt exist in Windows Fundamentals for
Legacy PCs (WinFLP) SP2, SP3.
the following is the error message from using the null device on these
systems:

C:\>echo > nul
The system cannot find the file specified.

C:\>echo > NUL
The system cannot find the file specified.

its very strange limitation of this system made by default (though
this problem can be solved by installing of null device).
its much more strange but i got the same errors on some 2003 systems
when was testing my scripts contained output redirection to nul. to
say the truth i had not enough time to investigate the problem in all
the cases i met it (especially when was using scripts not for testing
but for working purposes on various machines). but decided not to use
thin ice solutions but increase universalism by using of alternative
variants (also checked on practice a lot on different nt systems).

thank you.

foxidrive

unread,
Apr 12, 2010, 5:54:51 AM4/12/10
to
On Mon, 12 Apr 2010 02:37:36 -0700 (PDT), alexsupra <alex...@gmail.com>
wrote:


Try this:

echo. > NUL


--
Regards,
Mic

alexsupra

unread,
Apr 12, 2010, 9:07:05 AM4/12/10
to
On 12 апр, 13:54, foxidrive <got...@woohoo.invalid> wrote:
> On Mon, 12 Apr 2010 02:37:36 -0700 (PDT), alexsupra <alexsu...@gmail.com>

there is no difference and it doesnt work if system doesnt contain or
has some problems with NUL device.

foxidrive

unread,
Apr 12, 2010, 9:20:39 AM4/12/10
to
On Mon, 12 Apr 2010 06:07:05 -0700 (PDT), alexsupra <alex...@gmail.com>
wrote:

>> NUL device driver actually doesnt exist in Windows Fundamentals for


>> >Legacy PCs (WinFLP) SP2, SP3.
>> >the following is the error message from using the null device on these
>> >systems:
>>
>> >C:\>echo > nul
>> >The system cannot find the file specified.
>>

>> Try this:
>>
>> echo. > NUL


>>
>there is no difference and it doesnt work if system doesnt contain or
>has some problems with NUL device.

Granted if there is no NUL device.

Does the WinFLP have an echo command? That's the other test I'd be
interested in seeing. I don't have access to WinFLP to try it.

--
Regards,
Mic

alexsupra

unread,
Apr 12, 2010, 10:49:14 AM4/12/10
to
On 12 апр, 17:20, foxidrive <got...@woohoo.invalid> wrote:
> On Mon, 12 Apr 2010 06:07:05 -0700 (PDT), alexsupra <alexsu...@gmail.com>

experiments show the "echo" command like other commands work well.
but the "nul" is the part of system enviroment provided by driver
%systemroot%\system32\drivers\null.sys which is absent in case of
WinFLP.
there are some other interesting things like two different command
line processors i.e. cmd.exe files (various versions, note compatible
with alien enviroment). one of them included in live part of system
and another one in its installation part inside the compressed
WinFLP.wim file.

foxidrive

unread,
Apr 12, 2010, 11:05:59 AM4/12/10
to
On Mon, 12 Apr 2010 07:49:14 -0700 (PDT), alexsupra <alex...@gmail.com>
wrote:

>> Does the WinFLP have an echo command? �That's the other test I'd be


>> interested in seeing. �I don't have access to WinFLP to try it.

>experiments show the "echo" command like other commands work well.


>but the "nul" is the part of system enviroment provided by driver
>%systemroot%\system32\drivers\null.sys which is absent in case of
>WinFLP.
>there are some other interesting things like two different command
>line processors i.e. cmd.exe files (various versions, note compatible
>with alien enviroment). one of them included in live part of system
>and another one in its installation part inside the compressed
>WinFLP.wim file.

Thanks. It's an OS I didn't know existed before today.


--
Regards,
Mic

Robert Riebisch

unread,
Apr 12, 2010, 2:43:06 PM4/12/10
to
Dennis Halver wrote:

@copy file1 file2 > nul

--
Robert Riebisch
Bitte NUR in der Newsgroup antworten!
Please reply to the Newsgroup ONLY!

Timo Salmi

unread,
Apr 13, 2010, 4:52:29 AM4/13/10
to
On 11.04.2010 22:45 jya...@peoplepc.com wrote:
> On 11 Apr 2010 16:04:42 GMT, ha...@persrec.com (Dennis Halver) wrote:
>> @copy file1 file2
>> When I run the batch file then at the command prompt window for this statement always a line appears:
>> 1 file(s) copied.
>> How can I suppress this info line?

> copy filea fileb > nul will suppress it.


> CAUTION - It will also suppress all result info! For instance, if the file
> to copy doesn't exist you won't see an error.

Fortunately, copy sets the errorlevel which can then be tested.

All the best, Timo

--
Prof. Timo Salmi mailto:t...@uwasa.fi ftp & http://garbo.uwasa.fi/

Hpage: http://www.uwasa.fi/laskentatoimi/english/personnel/salmitimo/


Department of Accounting and Finance, University of Vaasa, Finland

Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.php

Frank P. Westlake

unread,
Apr 13, 2010, 9:40:31 AM4/13/10
to
"alexsupra"
news:cf27e903-a592-47ec...@8g2000yqz.googlegroups.com...

>> >> NUL device driver actually doesnt exist in Windows Fundamentals
>> >> for
>> >> >Legacy PCs (WinFLP) SP2, SP3.

> ... the "nul" is the part of system enviroment provided by driver


> %systemroot%\system32\drivers\null.sys which is absent in case of
> WinFLP.

Is it the same if you use the nul device with these names (note the
colon):

> NUL:
> \\.\NUL
> \\.\NUL:

In my opinion a script should not "normally" be written to avoid the NUL
device. NUL should be used for its intended purpose and if it is absent
then any changes to the script should be implemented by the system
administrator. The administrator of a NULL-less system should be aware
that it is absent and of the general problem created by that absence. It
might be absent so that all output goes to standard output and this is
not normally the business of the script writer.

But if it is necessary to work around the absence of NUL, maybe this is
enough:

IF EXIST "%systemroot%\system32\drivers\null.sys" (Set "NUL=NUL:")
Else (Set "NUL=%TEMP%\NUL")

Or:

Echo=NUL is absent|Find "NUL is absent" && (Set "NUL=%TEMP%\NUL") ||
(Set "NUL=NUL:")


Frank


Mike S.

unread,
Apr 17, 2010, 8:42:20 AM4/17/10
to

In article <4bc1f319$0$6987$9b4e...@newsspool4.arcor-online.net>,


@copy file1 file2 >nul:

Twayne

unread,
Apr 22, 2010, 7:55:36 PM4/22/10
to
In news:hpt6np$k2t$03$1...@news.t-online.com,
Andrew <vnc_s...@t-online.de> typed:

More accurately, the output goes to the NUL device as opposed to the screen.
A look at stdio might be of assistance, too.


Rugxulo

unread,
May 18, 2010, 12:46:51 PM5/18/10
to
Hi,

@copy file1 file2 >NUL

lacla...@gmail.com

unread,
Feb 3, 2017, 8:30:33 AM2/3/17
to

lacla...@gmail.com

unread,
Feb 3, 2017, 8:31:10 AM2/3/17
to
On Sunday, April 11, 2010 at 9:04:42 AM UTC-7, Dennis Halver wrote:
nnnn

lacla...@gmail.com

unread,
Feb 3, 2017, 8:32:32 AM2/3/17
to
On Sunday, April 11, 2010 at 9:04:42 AM UTC-7, Dennis Halver wrote:
> hy8i
]-9u0-u909p
ij'ho8h'h'hh
> Dennis

lacla...@gmail.com

unread,
Feb 3, 2017, 8:45:54 AM2/3/17
to
On Sunday, April 11, 2010 at 9:14:23 AM UTC-7, Timo Salmi wrote:
> On 11.04.2010 19:04 Dennis Halver wrote:
> > @copy file1 file2
> > When I run the batch file then at the command prompt window for this statement always a line appears:
> > 1 file(s) copied.
> > How can I suppress this info line?
>
> http://www.netikka.net/tsneti/info/tscmd.php#nul
>
> All the best, Timo
>
> -- kk
> Prof. Timo Salmi mailto:t...@uwasa.fi ftp & http://garbo.uwasa.fi/
> Home page: http://www.uwasa.fi/laskentatoimi/henkilokunta/salmitimo/
> Department of Accounting and Finance, University of Vaasa, Finland
> Timo's FAQ materials at http://lipas.uwasa.fi/~ts/http/tsfaq.html

h;97t8yfr7tdt7dktyfdfuy

sohelra...@gmail.com

unread,
Apr 12, 2017, 10:41:37 AM4/12/17
to
In a batch file under WinXP I use some commands like:
@copy file1 file2 How can I suppress this info line?
source A file or list of files or a device to copy from
target A file, directory, or device to copy to
@file A text file containing the names of the source files, one per line (see @file lists for details)

/S(ubdirectories)
/F (No empty subdirectories)
/SX (single target directory)
/FTP:A (ASCII copy)
/T(otals)
/G (Display percentage)
/U(pdate target)

sohelra...@gmail.com

unread,
Apr 12, 2017, 10:42:30 AM4/12/17
to
On Sunday, April 11, 2010 at 9:34:42 PM UTC+5:30, Dennis Halver wrote:
> In a batch file under WinXP I use some commands like:
>
> @copy file1 file2
>
> When I run the batch file then at the command prompt window for this statement always a line appears:
>
> 1 file(s) copied.
>
> How can I suppress this info line?
>
> Dennis

sohelra...@gmail.com

unread,
Apr 12, 2017, 10:44:53 AM4/12/17
to
My Neme Sohel khan Mo/8800399757 Call me

pro...@berkeley.edu

unread,
Apr 12, 2017, 1:35:49 PM4/12/17
to
copy file1 file2 1>nul

--
Phil Robyn

Kerr Mudd-John

unread,
Apr 13, 2017, 5:14:10 AM4/13/17
to
Looks to me he's using
https://jpsoft.com/help/copy.htm

and getting the help message.
<quote>
If you don't specify any arguments, COPY will display its command dialog.
</quote>


> --
sig sep needs a trailing space


--
Bah, and indeed, Humbug

sohelra...@gmail.com

unread,
Apr 20, 2017, 11:20:52 AM4/20/17
to
0 new messages