Created
September 8, 2021 00:06
イーサネットデバイスをpowershellから「無効→有効」にする。デバイスマネージャーで「無効→有効」するのと同じ効果。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo LANケーブルを抜いてください。 | |
pause | |
@echo on | |
powershell -Command "$devlan2 =Get-PnPDevice -FriendlyName 'Intel(R) Ethernet Connection I217-V'; Disable-PnpDevice $devlan2.DeviceID -Confirm:$false" | |
timeout 10 | |
powershell -Command "$devlan2 =Get-PnPDevice -FriendlyName 'Intel(R) Ethernet Connection I217-V'; Enable-PnpDevice $devlan2.DeviceID -Confirm:$false" | |
timeout 10 | |
netsh interface ip set address "LAN1" dhcp | |
netsh interface ip set dns "LAN1" dhcp | |
timeout 5 | |
netsh interface ip set address "LAN1" dhcp | |
netsh interface ip set dns "LAN1" dhcp | |
ipconfig | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment