Sign in to follow this  
Followers 0
RìggníX

netsh > just change ip, not subnet mask

1 post in this topic

hi

i'm tryin to change the local ip of the first ethernet adapter. but i want to keep subnet mask, gateway, ...

i get the name of the adapter by

$cmd = "netsh interface ip show config"
$foo = Run($cmd, @SystemDir, @SW_HIDE, $STDOUT_CHILD)
$line = ""
While 1
    $line &= StdoutRead($foo)
    If @error Then ExitLoop
WEnd
$adaptorname_start = StringInStr($line, chr(34), 0, 2) + 1
$adaptorname_stop = StringInStr($line, chr(34), 0, 3)
$adaptorname = StringMid($line, $adaptorname_start, $adaptorname_stop - $adaptorname_start)

now if i run

netsh interface ip set address name="LAN" source=static 192.168.0.4

netsh returns a syntax error.

any1 got an idea?


greetz, RìggníXBiTrAtE.tk

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0