2017-06-25 26 views
1

當編寫一個批處理文件來改變我的IP地址設置爲靜態我創造了這個工作腳本,但現在它顯示批處理文件沒有按任意鍵繼續

Changing IP address 
Waiting for "2" seconds and press any key to continue  
Changing Gateway  
Waiting for "2" seconds and press any key to continue 
Changing Subnet 
waiting for "2" seconds and press any key to continue 

方式我想讓它顯示是

Changing IP address  
Sits 2 seconds with no display of text 
Changing Gateway 
Sits 2 seconds with no display of text 
Changing subnet 
Sits 2 seconds with no display of text 

現在,我使用的超時命令

下面的代碼片段

@ECHO IP Address Changed 
timeout 2 
@ECHO Subnet Changed..... 
timeout 2 
@ECHO Gateway Changed.... 
timeout 2 

任何人都知道如何與timeout命令或其他命令做..我只是在尋找它看起來像它的一次改變各區域1

回答

1

使用以下:

timeout /T 2 /NOBREAK > nul 

> nul零件將輸出重定向到空設備,因此將其抑制。 /NOBREAK選項可防止等待時間被任何按鍵中斷。

1

使用刪除輸出> NUL

timeout /t 10 > nul 
相關問題