Question Locked

netsh command static ip assign

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi I cant get this to work...
---------------------------
@echo off
SET /P IP= IPADRESS:
SET /P MASK= SUBNET:
SET /p GW= GATEWAY:
netsh interface ip set address "Local Area Connection" static %IP% %MASK% %GW%
pause
----------------------------
Why?? i would like to have a small batfile just doit..
aia have tryed with vbs very messy

3 replies

by fwang

netsh interface ip set address local static IP Mask Gateway GWmetric

For example:
netsh interface ip set address local static 10.0.0.5 255.255.255.0 10.0.0.1 1

for gwmetric: The metric for the default gateway. This field should not be set if gateway is set to "none".

This discussion is closed to new replies.