Use batch file timeout without echo command?

I am new to batch scripting, but quite competent in programming in general. I am currently invoking a perl script from a batch file and displaying the result from a perl script in a Windows command window for 10 seconds before exiting the command window.

I use the command

timeout /t 10 /nobreak 

which is then also printed in the command window after the result of the perl script.

Is there a way to prevent this from happening so that I just see the result of the perl script and then look at the timer count down?

I understand that I can add '> NUL' to my timeout command to suppress the countdown timer, but that is not what I want to do. I just want to prevent what I see as a line of code printing in the command window. If this cannot be done, this is not a problem; I will live with him. But if I can remove it, I would like to.

Thanks in advance for your help!

+8
windows cmd batch-file
source share
2 answers

If you want to avoid repeating one command, attach it to @ :

 @timeout /t 10 /nobreak 

You can turn off the echo altogether with the command

 echo off 

Usually you put

 @echo off 

at the beginning of the batch file, so no commands are output.

+13
source share

Try to do

 timeout /t 10 nobreak>nul 
+2
source share

All Articles