Guest User

Untitled

a guest
Jan 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment