how to find shared drive IP address if i have a path for that shared drive in java or cmd prompt

mdp picture mdp · Oct 8, 2012 · Viewed 19k times · Source

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?

Answer

Alfabravo picture Alfabravo · Oct 8, 2012

Via cmd prompt, you can get the IP pinging to 'sample' (following your example in the question) as the console must resolve hostname to IP address.

Via java, perhaps InetAddress.getByName('sample') could work.

All this assuming the shares are not going over NetBIOS and all the old stuff. That doesn't work over IP as the comment says.