@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
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
@COPY SOURCE [DESTINATION] >NUL
copy a b >nul
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...
this works
@copy file1 file2>NUL
>NUL kills the echo to screen
Andrew
============================
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.
::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
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!
I agree, the NUL device is in every Microsoft OS AFAIK.
--
Regards,
Mic
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.
Try this:
echo. > NUL
--
Regards,
Mic
there is no difference and it doesnt work if system doesnt contain or
has some problems with NUL device.
>> 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
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.
>> 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
@copy file1 file2 > nul
--
Robert Riebisch
Bitte NUR in der Newsgroup antworten!
Please reply to the Newsgroup ONLY!
> 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
> ... 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
More accurately, the output goes to the NUL device as opposed to the screen.
A look at stdio might be of assistance, too.
@copy file1 file2 >NUL