Jump to content

netsh > just change ip, not subnet mask

Recommended Posts


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
$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

netsh returns a syntax error.

any1 got an idea?

greetz, RìggníXBiTrAtE.tk

Link to comment
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...