try {
String line = null;
String[] commands = new String[] { "cmd", "/C", "net share" };
Process child = Runtime.getRuntime().exec(commands);
InputStream ins = child.getInputStream();
BufferedReader buffReader = new BufferedReader(
new InputStreamReader(ins));
while (!(line = buffReader.readLine()).trim().equals(
"The command completed successfully.")) {
System.out.println(line);
}
} catch (Exception exp) {
}