第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在批處理文件/cmd中睡眠5秒

如何在批處理文件/cmd中睡眠5秒

如何在批處理文件/cmd中睡眠5秒Windows的截取工具可以捕捉屏幕,但有時我想在5秒后捕捉屏幕,例如通過攝像頭顯示的圖像。(例如,運行腳本并對著攝像機微笑。)如何在批處理文件中睡眠5秒?
查看完整描述

3 回答

?
www說

TA貢獻(xiàn)1775條經(jīng)驗 獲得超8個贊

一種方法是使用ping命令(MIS):

ping 127.0.0.1 -n 6 > nul

說明:

  • ping

    是發(fā)送ping請求的系統(tǒng)實用程序。

    ping

    在Windows的所有版本上都可用。
  • 127.0.0.1

    的ip地址是

    本地宿主

    ..此IP地址保證始終解析、可訪問并立即響應(yīng)pings。
  • -n 6

    指定有6個pings。在每個ping之間有一個1s的延遲,所以對于一個5s的延遲,您需要發(fā)送6個ping。
  • > nul

    抑制…的輸出

    ping

    ,通過

    重定向

    它給

    nul.


查看完整回答
反對 回復(fù) 2019-07-04
?
Qyouu

TA貢獻(xiàn)1786條經(jīng)驗 獲得超11個贊

我很驚訝沒有人提到:

C:\> timeout 5

N.B.不過,請注意(謝謝丹!)那,那個timeout 5指:

睡4到5秒

這可以通過將以下內(nèi)容放入批處理文件、反復(fù)運行并計算第一次和第二次之間的時間差來進(jìn)行經(jīng)驗驗證echos:

@echo off
echo %time%
timeout 5 > NUL
echo %time%


查看完整回答
反對 回復(fù) 2019-07-04
?
梵蒂岡之花

TA貢獻(xiàn)1900條經(jīng)驗 獲得超5個贊

試試看選擇命令。從MSDOS 6.0開始,它就已經(jīng)出現(xiàn)了,應(yīng)該可以做到這一點。

使用/T參數(shù)以秒為單位指定超時,使用/D參數(shù)指定默認(rèn)的選擇,然后忽略選定的選擇。

一個可能是問題的問題是,如果用戶在超時期間之前鍵入一個選擇字符。部分解決方法是混淆情況-使用/N參數(shù)隱藏有效選項的列表,并且在一組選擇中只有一個字符,這樣用戶在超時之前輸入有效選項的可能性就更小了。

下面是WindowsVista上的幫助文本。我認(rèn)為XP上的情況是一樣的,但是請查看XP計算機上的幫助文本來驗證。

C:\>CHOICE /?

CHOICE [/C choices] [/N] [/CS] [/T timeout /D choice] [/M text]

Description:
    This tool allows users to select one item from a list
    of choices and returns the index of the selected choice.

Parameter List:
   /C    choices       Specifies the list of choices to be created.
                       Default list is "YN".

   /N                  Hides the list of choices in the prompt.
                       The message before the prompt is displayed
                       and the choices are still enabled.

   /CS                 Enables case-sensitive choices to be selected.
                       By default, the utility is case-insensitive.

   /T    timeout       The number of seconds to pause before a default
                       choice is made. Acceptable values are from 0 to
                       9999. If 0 is specified, there will be no pause
                       and the default choice is selected.

   /D    choice        Specifies the default choice after nnnn seconds.
                       Character must be in the set of choices specified
                       by /C option and must also specify nnnn with /T.

   /M    text          Specifies the message to be displayed before
                       the prompt. If not specified, the utility
                       displays only a prompt.

   /?                  Displays this help message.

   NOTE:
   The ERRORLEVEL environment variable is set to the index of the
   key that was selected from the set of choices. The first choice
   listed returns a value of 1, the second a value of 2, and so on.
   If the user presses a key that is not a valid choice, the tool
   sounds a warning beep. If tool detects an error condition,
   it returns an ERRORLEVEL value of 255. If the user presses
   CTRL+BREAK or CTRL+C, the tool returns an ERRORLEVEL value
   of 0. When you use ERRORLEVEL parameters in a batch program, list
   them in decreasing order.

Examples:
   CHOICE /?
   CHOICE /C YNC /M "Press Y for Yes, N for No or C for Cancel."
   CHOICE /T 10 /C ync /CS /D y
   CHOICE /C ab /M "Select a for option 1 and b for option 2."
   CHOICE /C ab /N /M "Select a for option 1 and b for option 2."


查看完整回答
反對 回復(fù) 2019-07-04
  • 3 回答
  • 0 關(guān)注
  • 3995 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號