0

I'm making a little batch file to change some network adapter settings:

Can anyone please explain why this works:

netsh interface ipv4 set address name="Local Area Connection" static 192.168.1.11 255.255.255.0 192.168.1.1

However this doesn't (It amends the IP, SUBNET however it makes no changes to the Gateway):

set /p FIRSTIP=Please type the IP address provided: 
set /p SUBNETIP=Please type the Subnet IP provided: 
set /p DFTGATEWAY=Please type the Gateway provided: 

netsh interface ipv4 set address name="Local Area Connection" static %FIRSTIP% %SUBNETIP% %GATEWAY%

This is on a Windows 10 machine. I've been scratching my head at this one and most KB articles seem of little help.

  • 2
    DFTGATEWAY is not the same variable as GATEWAY – Ben Voigt Apr 17 '18 at 14:12
  • In the future, to troubleshoot things like this you can just use ECHO ON, or put ECHO in front of the line that's causing problems – Ben Voigt Apr 17 '18 at 14:14
  • @BenVoigt how did I not noticed that!!! Thank you ever so much :) – PKR Apr 17 '18 at 14:16
  • 1
    I'm voting to close this question as off-topic because finding a typo is unlikely to ever be interesting to future readers. – Ben Voigt Apr 18 '18 at 17:26

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.