Reputation: 1
Good afternoon everyone,
I am completely stumped and have exhausted all the links Master Google has to offer on this question; so it's time to ask the experts.
In short I'm trying to add 3 IP addresses the WINS list using a script. To configure this manually using windows control panel is simple yet time consuming and I wish to avoid this due to the number of PC's that need configuring. I have added an example screenshot of what I am attempting to achieve -IP Addresses are examples. WINS LIST Screenshot
I have tried the following batch script but it only adds the last address to the wins list.
netsh int ip set winsservers "Wi-Fi" static 10.0.0.1
netsh int ip set winsservers "Wi-Fi" static 10.0.0.2
netsh int ip set winsservers "Wi-Fi" static 10.0.0.3
I've tried a variation of this script that I came across that uses an index setting for example:
netsh int ip set winsservers "Wi-Fi" static 10.0.0.1 index=0
netsh int ip set winsservers "Wi-Fi" static 10.0.0.2 index=1
netsh int ip set winsservers "Wi-Fi" static 10.0.0.3 index=2
However this returns a syntax error. I have looked for a powershell script to do the same thing but again have come up empty handed in my research.
Any assistance will be greatly appreciate.
Upvotes: 0
Views: 884
Reputation: 38708
From my comment, my syntax expectation would have been:
%SystemRoot%\System32\netsh.exe interface ip add wins name=Wi-Fi addr=10.0.0.1 index=0
%SystemRoot%\System32\netsh.exe interface ip add wins name=Wi-Fi addr=10.0.0.2 index=1
%SystemRoot%\System32\netsh.exe interface ip add wins name=Wi-Fi addr=10.0.0.3 index=2
To learn more about the netsh.exe
executable, ENTER the following command examples in a Command Prompt window:
netsh /?
netsh interface /?
netsh interface ip /?
Upvotes: 0