Re: Copying silently.
- From: Frederick Williams <Frederick_Williams@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Mar 2007 03:16:11 GMT
Ali wrote:
On Tue, 13 Mar 2007 20:51:31 GMT, Frederick Williams commented
copy /y x y >> nul:
will copy x to y and not tell me that it's done so, nor will it ask me
to confirm that y should be copied over if it already exists. Good,
that (so far as it goes) is what I want.
Unfortunately if x doesn't exist I won't see the message "The system
cannot find the file specified.". I could test errorlevel if my copy
command was in a batch file, but I'd like it to be one command on the
command line. So my question is this:
Is there a switch to copy that means "Keep quite unless the source
doesn't exist."?
There is no switch that means "keep Quiet" at all, which is why you
redirect the output to nul:
It ought to be possible to redirect standard output and error output
independently of one another, you can with Unix.
If the output is important, leave it visible.
Xcopy may be of more use, particularly the \Q option
Trouble is
xcopy file-that-exists file-that-doesn't-exist
wants to know if file-that-doesn't-exist is a directory or not.
You do know that /? after any standard command lists its options?
Yes.
Thanks.
--
Remove "antispam" and ".invalid" for e-mail address.
We have lingered in the chambers of the sea
By sea-girls wreathed with seaweed red and brown
Till human voices wake us, and we drown.
.
- Follow-Ups:
- Re: Copying silently.
- From: pmj
- Re: Copying silently.
- From: Frederick Williams
- Re: Copying silently.
- References:
- Copying silently.
- From: Frederick Williams
- Re: Copying silently.
- From: Ali
- Copying silently.
- Prev by Date: Re: Copying silently.
- Next by Date: Lidos - was Re: 'ere we go again! :( This sounds better
- Previous by thread: Re: Copying silently.
- Next by thread: Re: Copying silently.
- Index(es):
Relevant Pages
|