Hi,
I am trying to write a small program that has the ability to change the pc's IP address, Workgroup and DNS settings.
Can anyone tell me if this is possible, and how to do it, or point me to any resoucres.
Many Thanks
Magic
Hi,
I am trying to write a small program that has the ability to change the pc's IP address, Workgroup and DNS settings.
Can anyone tell me if this is possible, and how to do it, or point me to any resoucres.
Many Thanks
Magic
Windows XP Pro
Good, then it's easy. Use netsh.
You may also find these links usefull:
http://faq.cprogramming.com/cgi-bin/...&id=1043284392
http://www.google.com/search?sourcei...GLD:en&q=netsh
gg
I recently did some work with netsh so can offer these command samples:
I don't think that netsh can change the workgroup name but you can use the NetJoinDomain function.Code:/* Sets the DNS servers. */ netsh interface ip set dns name="Local Area Connection" source=static addr=10.0.0.1 netsh interface ip add dns name="Local Area Connection" addr=10.0.0.2 /* Sets the IP address. */ netsh interface ip set address name="Local Area Connection" addr=10.0.0.9 mask=255.255.255.0 gateway=10.0.0.1
Alternatively, these tasks can be performed using WMI with the Win32_NetworkAdapterConfiguration and Win32_ComputerSystem classes.