i'm trying to get a list of MAC addresses of available wifi networks with java .
i have found a command line that returns a perfect result
netsh wlan show networks mode=Bssid | findstr "BSSID"
but when executing this command with Runtime().getRuntime().exec() i'm getting error and the
program prints the command's help
what am i doing wrong ??
try {
String command="netsh wlan show networks mode=Bssid | findstr \"BSSID\"";
InputStream input = Runtime.getRuntime().exec(command).getInputStream();
InputStreamReader reader = new InputStreamReader(input);
BufferedReader buffer = new BufferedReader(reader);
String line="";
while((line=buffer.readLine()) != null ){
System.out.println(line);
}
} catch (IOException e) {
e.printStackTrace();
}