netsh causes syntax error in Win8

0

I create a .bat file for change network using netsh:

netsh interface ip set address name=Wireless source=static addr=192.168.43.100 mask=255.255.255.0 gateway=192.168.43.1

In Windows-7 work fine, but in Windows-8+ not work and return this error:

The syntax of the command is incorrect

How use netsh command for change IP address in Windows-8?

Note: I run the BAT file as Admin

Guilherme Nascimento

Posted 2015-02-23T18:05:56.883

Reputation: 115

have you tried 'address' instead of 'addr'? – Erlis D. – 2015-02-23T18:26:12.133

@ErlisD. Thanks, I tried, but shows the same error: syntax of the command is incorrect – Guilherme Nascimento – 2015-02-23T18:27:20.557

Try this one: netsh interface set address name=Wireless source=static address=192.168.43.100 mask=255.255.255.0 gateway=192.168.43.1 If that doesn't work, in cmd enter the commands separately, like: netsh, then interface and after that: set address name=Wireless source=static addr=192.168.43.100 mask=255.255.255.0 gateway=192.168.43.1 – Erlis D. – 2015-02-23T18:37:07.270

@ErlisD. Not work, shows command not foud: set address name="Wireless" – Guilherme Nascimento – 2015-02-23T19:27:20.037

My bad! Try adding an ip between the interface and the set: netsh interface ip set address name=Wireless source=static address=192.168.43.100 mask=255.255.255.0 gateway=192.168.43.1 – Erlis D. – 2015-02-23T23:09:21.997

No answers