728x90
윈도우 IP 자동할당 스크립트 (batch 파일)
이 포스트는 이전 블로그에서 이전된 포스트입니다.

 

- 고정 IP로 변경할 경우

@echo off

netsh interface ip set address name="<랜카드이름>" source=static <ip> <subnet> <gateway> 1

netsh interface ip delete dns "<랜카드이름>" all

netsh interface ip add dns "<랜카드이름>" <ip>

netsh interface ip add dns "<랜카드이름>" <ip>

ipconfig /all

pause

 

 

- DHCP 서버에서 자동 할당 받도록 하기

@echo off

netsh interface ip set address name="<랜카드이름>" source=dhcp

netsh interface ip delete dns "<랜카드이름>" all

ipconfig /all

pause

 

 

두 소스 모두 메모장에서 열어서 파일 형식을 '모든 파일'로 변경후 .bat 확장자로 저장하시면 실행 파일로 사용가능합니다.

 

728x90

+ Recent posts