ipconfig/all is so simple, why make another program for it? Just look at the results or capture them and look for the Dhcp line.