PDA

View Full Version : How to execute Powershell command from QT?



Gokulnathvc
21st January 2014, 11:49
I would like to execute the powershell command Get-WmiObject win32_pnpsigneddriver -filter "DeviceName='Disk drive'" | Select DriverVersion which gives the driver version of SSD from Qt.

anda_skoa
21st January 2014, 12:15
You can run any external program using QProcess.

But I would be surprised if Windows doesn't have a C or C++ API for doing that, after all Powershell needs to get the value somewhere.

Cheers,
_

Gokulnathvc
21st January 2014, 13:25
I would like to run the powershell command from Qt and get the driver version without opening powershell dialog.

ChrisW67
21st January 2014, 23:30
You have been told how to run a process from a Qt program.

The process you run has nothing to do with Qt, so you should consult the provider's documentation:
http://technet.microsoft.com/en-us/library/hh847736.aspx