Using wmic to get info
I'm making a QT application to retrieve info from OS.I'm trying to access wmic.exe directly ( i added the path Windows\System32\wbem\ previously in the code ) and i don't want to use it through cmd.The code works fine in Windows Vista/7 but doesnt work in Windows XP
Sample code :
@ QProcess process;
process.start(QString("wmic bios get serialnumber"));
Note : I'm using QT 4.6
Any Ideas ?
Hi and welcome to devnet,
Are you sure the command is available on XP and at the same place ?
yes im pretty sure 100% u can even launch it from there and type the command and will work fine.I've been searching for a solution for days and no one is solving it.I'd appreciate it alott if u figure it out
Are there any messages error, etc printed out ?
What if you remove system("pause"); line ?
No error messages are printed out . In win xp it just shows the console dash like forever no results are shown and program never ends while in win vista/7 normal results are shown.
I tried removing system("pause") same issue.
Did you read the standard out/error channels of QProcess ?
There is literally 0 errors , that's why it's making me crazy
Did you check whether waitForStarted and waitForFinished returns true ?
yes so if i set a short time for waitforfinished lets say 2 sec , it will return empty result and program successfully ends
What's the exit code ?
Solved same problem a year ago.
This is part of working function from my app:
QString Arguments = "/node:" + IP + " " + Args + " get /format:list";
Process.write (Arguments.toUtf8 ());
while (Process.waitForReadyRead ())