Need to know how to work with the echo command in this scenario.
In my batch file, this is my setup:
set /p input=Enter:
if %input% == 1 goto :1
if %input% == 2 goto :2
if %input% == 3 goto :3
After entering 3, it returns the following:
if 3 == 1 goto :1
if 3 == 2 goto :2
if 3 == 3 goto :3
At :3
xcopy “c:\users\username\test” “e:\test” /d /y
I am running an xcopy command to copy only changed files to an external drive
Before the input script, I have @echo off so I don’t see any details of the commands running. By doing that, when it gets to the xcopy command it only returns the files copied. I need to know the full command path it's running.
How do I setup the batch file to NOT display background details and when it gets to the xcopy command to show the full path command of what it is copying, not just numbers of files being copied?
Thanks in advance.
DOS echo command help
Moderator: DosItHelp
Re: DOS echo command help
IF you really do have @ECHO OFF at the top of your script you should not see any verbose output from the IF commands executing. In regards to XCOPY, I bet if you read the help file, you will see an option to DISPLAY the files it is copying.
Re: DOS echo command help
falcios wrote:How do I setup the batch file to NOT display background details and when it gets to the xcopy command to show the full path command of what it is copying, not just numbers of files being copied?
If you want to see the xcopy command line write echo on in the line before and @echo off in the line after. You may start your Batch Code with
@echo off &prompt $
in order to suppress the beginning command prompt.
If you only want to see the files copied keep echo switched off. Instead use option /f with xcopy.
Steffen
Re: DOS echo command help
Thanks to you both. Exactly what I was looking for.