DOS echo command help

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
falcios
Posts: 43
Joined: 02 Mar 2017 05:38

DOS echo command help

#1 Post by falcios » 02 Mar 2017 09:56

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. 

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: DOS echo command help

#2 Post by Squashman » 02 Mar 2017 10:38

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.

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: DOS echo command help

#3 Post by aGerman » 02 Mar 2017 11:21

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

falcios
Posts: 43
Joined: 02 Mar 2017 05:38

Re: DOS echo command help

#4 Post by falcios » 02 Mar 2017 12:03

Thanks to you both. Exactly what I was looking for.

Post Reply