Hello there,
i want to query some system informations and want to use wmi. It looks like there is no direct way to do this in b4j so i decide to use the shell and the wmic-command.
For example - when i want to get the cpu load i can call
This works fine from the commandline, but when i call it from the shell it failed
I have tried multiple versions like
Returns: cpu get loadpercentage - Alias wurde nicht gefunden.
Returns: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "wmic cpu get loadpercentage" (in directory "."): CreateProcess error=2, Das System kann die angegebene Datei nicht finden)
all failed, but when i only call the wmic
i got "wmic:root\cli>" - so wmic is found.
Can anybody help me?
Regards
Matze
i want to query some system informations and want to use wmi. It looks like there is no direct way to do this in b4j so i decide to use the shell and the wmic-command.
For example - when i want to get the cpu load i can call
B4X:
wmic cpu get loadpercentage
B4X:
Dim shl As Shell
shl.Initialize("shl", "wmic", Array("cpu get loadpercentage"))
I have tried multiple versions like
B4X:
Dim shl As Shell
shl.Initialize("shl", "wmic", Array("cpu get loadpercentage"))
B4X:
shl.Initialize("shl", "wmic ", NULL)
all failed, but when i only call the wmic
B4X:
Dim shl As Shell
shl.Initialize("shl", "wmic", NULL)
Can anybody help me?
Regards
Matze