Jump to content

How to set IP address


 Share

Recommended Posts

You can try running a cmd prompt and using it to execute a string you built...

$cmd='netsh interface ip set address name="Local Area Connection" static 192.168.1.50 255.255.0.0 192.168.1.1 1'
Run(@ComSpec & " /c " & $cmd, "", @SW_SHOW)
Link to comment
Share on other sites

You can try running a cmd prompt and using it to execute a string you built...

$cmd='netsh interface ip set address name="Local Area Connection" static 192.168.1.50 255.255.0.0 192.168.1.1 1'
Run(@ComSpec & " /c " & $cmd, "", @SW_SHOW)
I tested this code, but run time is between 4~22 seconds in my 2 computers which runs Win2K, other is WinXP, too slow, so I hope to call Win32API to set my host's IP address.
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
 Share

  • Recently Browsing   0 members

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