I’ve created small tool(for windows XP/Vista), writen in visual basic 6.this tool was created for switching between static LAN ip to DHCP and back to original static IP (original IP saved in temporary variable) without opening network configuration, And without typing anything, just few mouse click is what we need. This tool using Windows Management Instrumentation for enumerating all network interface, get parameters, and set parameters.
Set objwmiservice = GetObject("winmgmts:\\.\root\cimv2") Set colNIC_Config = objwmiservice.ExecQuery("Select * from Win32_NetworkAdapterConfiguration WHERE Index='" && _ Netconf.strIFIndex(CboIF.ListIndex) && "' AND IPEnabled=TRUE")
I’ve included source code, so you can freely modify and use it according to your needs. No additinal components’s needed here just basic Microsoft Scripting Runtime , Microsoft Shell Control And automation.
i’ve just test it on my desktop and my friend’s notebook, i don’t know if there’s any bug or malfunction on other system.
here’s the source code [download#7]
enjoy 🙂
you left out the module -.-
whooppss, sorry it’s been a long time since i wrote this atricle and prog, i’ve never realized i’ve missed the module 😀 i’ll upload the module soon
i trying write in VB .Net, and still not found the code.
do you have this application code in VB.NET?
thanks.
no, i don’t have the code for VB .net, but if you notice the code i wrote in VB is just interfacing to microsoft scripting runtime.