Jump to content

Recommended Posts

Posted

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)
Posted

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.
Posted

I didn't have a chance to test it, so I'm surprised it worked at all...at least on the first shot anyway. Good luck with your Win API... can you post it if you get it figured out?

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