0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

BAT ネットワークアダプター(イーサネット)IP取得自動取得に変更

Last updated at Posted at 2021-06-07

1.jpg

@echo off
netsh interface ip set address "イーサネット" dhcp
netsh interface ip set dns "イーサネット" dhcp
netsh interface set interface "イーサネット" disable
netsh interface set interface "イーサネット" enable


if %errorlevel% neq 0 (
netsh interface ip set address "イーサネット 2" dhcp
netsh interface ip set dns "イーサネット 2" dhcp
netsh interface set interface "イーサネット 2" disable
netsh interface set interface "イーサネット 2" enable
echo アダプター名イーサネット 2を変更しました。
)else if %errorlevel% equ 0(
echo アダプター名イーサネットの設定を変更しました。
)else (
echo エラーで設定できませんでした。
)
pause
exit


0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?