延迟一段时间最常用的命令之一是 ping

基本用法

PING -n 1 -w 1000 1.1.1.1

REM the -n 1 flag means to send 1 ping request.
REM the -w 1000 means when the IP(1.1.1.1) does not respond, go to the next command
REM 1.1.1.1 is an non-existing IP so the -w flag can ping a delay and go to next command

这将在批处理文件/控制台上输出以下内容:

C:\Foo\Bar\Baz>ping -n -w 1000 1.1.1.1

Pinging 1.1.1.1 (Using 32 bytes of data)
Request timed out

Ping statistics for 1.1.1.1
    Packets: Sent = 2,Received = 0, Lost = 1(100% loss)

隐藏文本回显

只需在命令后面添加 >nul 即可将其重定向为 null。

ping -n w 1000 1.1.1.1 >nul

这不会输出任何东西。