4

I've just been messing around with CMD, and making animated ascii art. I've been attempting to use the Timeout command on my Windows 2000 laptop, however every time I attempt this, it just says it isn't an internal or external command or batch file.

This is on an old Toshiba 3110CT laptop running Windows 2000; I got it from a thrift store at some point. I've tried this on my Windows 10 laptop, and the code works perfectly fine there, but the 2000 laptop is my coding laptop, and I would like it if it were on there.

@echo off
cd %SystemRoot%\system32\
timeout.exe /t 1 /nobreak >nul

I expect for it to wait for a second, and then display the next frame of my ascii animation. Instead, it just tells me that "'timeout.exe' is not recognized as an internal or external command, operable program or batch file."

Lionmeow
  • 79
  • 6
  • timeout.exe was not added until Windows 7. –  Jul 03 '19 at 05:36
  • weird; I swear after lots of research it said timeout was introduced in 2000. i just looked again, now says windows 7. Huh. Is there any other ways I can delay? – Lionmeow Jul 03 '19 at 05:39
  • According to [this resource](https://ss64.com/nt/timeout.html), `timeout.exe` has been introduced in Windows 7... – aschipfl Jul 04 '19 at 15:28

1 Answers1

6

According to the documentation from the Technical Library, timeout was only introduced on home versions of Windows starting with XP. As such, using timeout won't work on Windows 2000 (but will work on Windows Server 2000).

If you're still in need of making the batch wait, you can use this hacky ping call to make the batch wait for a set amount of time in milliseconds.

To make your batch wait for 1 second, do this:

ping 127.255.255.255 -n 1 -w 1000 >nul

Explanation:

  • 127.255.255.255 is a local loopback address and is used (at least in Windows) specifically for broadcast purposes. Any requests made to this address won't get retransmitted to the client machine.
  • -n [number] denotes the number of times that the command should try to ping this address, in this case, 1 time.
  • -w [number] denotes the amount of time in milliseconds that the command should wait for a response before timing out, in this case, 1000 milliseconds.
  • >nul makes the output redirect from stdout to null, as such the actual output from the ping command won't show on your command prompt. If you wanted to be super safe, you could also redirect the output from stderr to null as well by adding 2>nul at the end.
Hoppeduppeanut
  • 1,109
  • 6
  • 20
  • 29