I have a path windows network shared drive like this .
String url="//sample/data/Documents/network/test/";
How can i find the Ip address of the that drive using this path using a java program or cmd prompt?
Although @Greg is right I think in most cases you can extract the host name from the URL and then use InetAddress.getByName()
, i.e. something like the following
String host = url.substring(2).replaceFirst("/.*", "");
InetAddress.getByName(host);