SHARE
TWEET

Untitled

a guest Jan 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :: Set IP Ethernet Static / DHCP
  2. :: setip d          | Set Ethernet as DHCP
  3. :: setip s 100      |  
  4.  
  5. @echo off
  6. IF "%1%" == "s" (
  7.     CMD /c netsh.exe interface ipv4 set address name=\"Ethernet\" static 192.168.%2.22 255.255.255.0 192.168.%2.1
  8. )
  9.  
  10. IF "%1%" == "d" (
  11. :: runas /user:ldtuyen  "cmd.exe /c netsh.exe interface ipv4 set address name=\"Ethernet\" source=dhcp"
  12.     CMD /c netsh.exe interface ipv4 set address name=\"Ethernet\" source=dhcp
  13. )
  14.  
  15. IF "%1%" == "h" (
  16.     echo "setip s 100 -- Set Ethernet as Static 192.168.100.22"
  17.     echo "setip d -- Set Ethernet as DHCP "
  18. )
  19. :: ./netsh interface ipv4 set address name="Ethernet" static 192.168.0.2 255.255.255.0 192.168.0.1
  20. :: ./netsh interface ipv4 set address name="Ethernet" source=dhcp
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top