2016-08-14 71 views
0

我是一名Unix傢伙,我需要幫助在Windows 10上編寫腳本來執行以下操作。Windows腳本(睡眠後禁用NIC)

  1. 睡眠60秒
  2. 禁用端口Ethernet
  3. 睡眠5秒
  4. 啓用端口Ethernet

我不知道在Windows開始。

+3

你有什麼試過的?你看過http://stackoverflow.com/questions/7469340/how-to-disable-or-reset-a-network-adapter-programmatically-in-c-sharp – zhon

回答

1

我想通了。

timeout /t 60 
netsh interface set interface "Ethernet0" DISABLED 
timeout /t 5 
netsh interface set interface "Ethernet0" ENABLED 
timeout /t 60