Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use batch file timeout without echoing command?

I'm fairly new to batch scripting but reasonably competent with programming in general. I'm currently calling a perl script from a batch file and am displaying the result from the perl script in the Windows command window for 10 seconds before exiting the command window.

I'm using the command

timeout /t 10 /nobreak

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

Is there any way to prevent this so that I just see the result of the perl script and then see the timer counting down?

I understand I can append '> NUL' to my timeout command to suppress the countdown timer but this isn't what I want to do. I just want to prevent what I see as a line of code printing to the command window. If this can't be done, it's no problem, I'll live with it. But if I can remove it I'd like to.

Thanks in advance for any help!

like image 974
pminogue Avatar asked Jul 24 '13 09:07

pminogue


2 Answers

If you want to avoid echoing one command, prefix it with @:

@timeout /t 10 /nobreak

You can disable echoing at all with command

echo off

Normally, you put

@echo off

at beginning of batch file, so commands are not outputed.

like image 75
LS_ᴅᴇᴠ Avatar answered Sep 18 '22 09:09

LS_ᴅᴇᴠ


Try doing,

timeout /t 10 nobreak>nul
like image 43
user6024091 Avatar answered Sep 18 '22 09:09

user6024091