Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Folks,
Am creating a bat file in XP and putting a shortcut to it on the desktop.
It is used to backup an entire directory, as needed.
@ECHO OFF (or %ECHO OFF) works great for suppressing the display of any subsequent commands....Except for XCOPY, for some reason.
When using XCOPY to copy the entire directory quickly, the cmd window displays all the file names as they are being copied...as if the @ECHO OFF was not even there.
It works fine suppressing the display of all the other commands....just not XCOPY.
Is there some reason for this....or am I doing something incorrectly?
(the bat runs fine otherwise)
Thanks
> PLEASE HELP OTHERS - Report back what did/didn't work for those referencing this thread.<

@echo off is a command for the Command Interpreter only to suppress displaying commands, not for Xcopy. Are you using the /Q switch with Xcopy?

I think I have seen this happen before, is the xcopy command in a code block(inside brackets, like this comment) by any chance?
Try:
@xcopy .......If it is a code block then you can also try:
@( ......

Tried a few at the command prompt, > nul seems the best option.
←C:\>xcopy trial.bat %temp%
C:trial.bat
1 File(s) copied←C:\>xcopy /q trial.bat %temp%
1 File(s) copied←C:\>xcopy trial.bat %temp% > nul -<----- Best option?
←C:\>@xcopy trial.bat %temp%
C:trial.bat
1 File(s) copied←C:\>@(xcopy trial.bat %temp%)
C:trial.bat
1 File(s) copied

Ok I've tracked down the script I wrote that came to mind:
::List files modified since date on drive %dl%... @ECHO OFF set dl=c set mdy=5-13-09 ( xcopy %dl%:\ %dl%:\fake /l /i /f /d:%mdy% for /f "delims=" %%a in ('dir %dl%:\ /ad/b') do @xcopy "%dl%:\%%a" %dl%:\fake /l /i /s /f /d:%mdy% )|for /f "delims=^>" %%b in ('find "\"') do @( set fn=%%b call set fn="%%fn:~0,-3%%" call echo %%fn%% ) pauseTry it with and without the extra @'s on the xcopy or code block, removing either yields unexpected results for me. The first 5 lines with only the xcopy's @ removed and most of the output without the @ on the code block.
Even still I agree that redirecting to nul is probably the best way to go and what was happening in the above script probably has lttle to do with this thread.....

Thanks very much for the responses.I feel kinda a little silly here...
I've used xcopy some...but have never really read through all the switches...and should have.
The /Q which does suppress the listing of file names just fine. Thanks Gari.
I did notice, though, after copying...it does still display the summary total (files copied) message.
Did try the others (except Resp 4...not yet )
I don't think that was mentioned in any of the switch descriptions.
Has anyone been able to suppress that last line?
-Thanks
-------------------------------------------------------------Here is the current batch:
@echo off
echo.
echo. PLEASE WAIT WHILE FILES ARE BACKED UP
echo.
xcopy c:\mystorage\*.* e:\backup /s/y/q
echo.
echo. ** BACKUP COMPLETE - THANK YOU **
echo.
pause
exitResults in:
PLEASE WAIT WHILE FILES ARE BACKED UP
218 File(s) copied
** BACKUP COMPLETE - THANK YOU **
Press any key to continue...
> PLEASE HELP OTHERS - Report back what did/didn't work for those referencing this thread.<

No guarantees but try redirecting Xcopy advisory output to the nul device.
e.g.
xcopy c:\mystorage\*.* e:\backup /s/y/q > nulVal.

![]() |
![]() |
![]() |

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