2016-08-14 70 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