Page 1 of 1

Timeout not working in file-works in command line

Posted: 28 Jun 2023 19:04
by dtmenges
I am having a problem using timeout in a batch file. It seems to go into some sort of loop. When I put the following code in a batch file, it just continuously echos "Hello World" until I Ctrl-C to end.

@echo off
echo Hello World
timeout /T 5
pause

I've tried this on both Window 7 and Windows 10 with the same results. If I enter timeout /T 5 in a command line, it works as expected.

Regards,
Dave

Re: Timeout not working in file-works in command line

Posted: 29 Jun 2023 01:55
by jeb
Hi dtmenges,

I guess you called your batch file "timeout.bat"?
Think a bit about the name

Re: Timeout not working in file-works in command line

Posted: 29 Jun 2023 05:23
by dtmenges
How about that! Renamed to test.bat and everything is just peachy.

Thanks, Jeb.

Dave