I am trying to get the details of USB hardware devices connected to computer but I don't know the native code of windows so is it possible to get the details of hardware connected to computer using JAVA Thanks in advance
vbscript code:
Set HDs = GetObject("winmgmts:(impersonationLevel=impersonate)")
Set colItem=HDs.ExecQuery("Select * from Win32_DiskDrive")
For Each hd In colItem
Wscript.Echo hd.PnPDeviceID & "vigi"
Next
java code:
try {
Process p = Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath());
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line = input.readLine()) != null) {
result += line;
}
input.close();
} catch(Exception e){
e.printStackTrace();
}
now i'm trying to get the details using this vbscipt code but when i'm executing this code the error comes no script found