เปลี่ยน ip address script
เขียน Script ไว้แล้ว Save เป็น .Bat
เมื่อเราต้องการใช้แบบ Static ก็คลิ๊กตัวนึง
เมื่อเราต้องการใช้แบบ DHCP ก็คลิ๊กตัวนึง
ตัวอย่างรูปแบบคำสั่งด้านล่างนะครับ
-----------------------------------------------------------------------
คำสั่งเปลียน IP Subnet และ Gateway ให้เป็นแบบ Static
netsh interface ip set address "ชื่อCardLan" static "IP" "Subnet" "GW" 1
ตัวอย่าง
netsh interface ip set address Wlan static 192.168.0.22 255.255.255.0 192.168.0.2 1
เอาใส่ Notepad แล้วก็ Save เป็น .Bat
-----------------------------------------------------------------------
คำสั่งเปลียน IP Subnet และ Gateway ให้เป็นแบบ DHCP
netsh interface ip set address "ชื่อCardLan" dhcp
ตัวอย่าง
netsh interface ip set address Wlan dhcp
เอาใส่ Notepad แล้วก็ Save เป็น .Bat
-----------------------------------------------------------------------
คำสั่งเปลี่ยน DNSให้เป็นแบบ DHCP
netsh interface ip set dns "ชื่อการ์ดlan" dhcp
ตัวอย่าง
netsh interface ip set dns Wlan dhcp
เอาใส่ Notepad แล้วก็ Save เป็น .Bat
-----------------------------------------------------------------------
คำสั่งเปลี่ยน DNSให้เป็นแบบ Static
netsh interface ip set dns "ชื่อการ์ดlan" static "DNS"
ตัวอย่าง
netsh interface ip set dns Wlan static 192.168.0.2
เอาใส่ Notepad แล้วก็ Save เป็น .Bat
ความคิดเห็น
แสดงความคิดเห็น