Results 1 to 4 of 4

Thread: How to execute Powershell command from QT?

  1. #1
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default How to execute Powershell command from QT?

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to execute Powershell command from QT?

    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,
    _

  3. #3
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to execute Powershell command from QT?

    I would like to run the powershell command from Qt and get the driver version without opening powershell dialog.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to execute Powershell command from QT?

    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/l.../hh847736.aspx

Similar Threads

  1. Execute window command line-by-line using QProcess
    By nhocjerry in forum Qt Programming
    Replies: 5
    Last Post: 30th July 2013, 12:21
  2. Execute multiple sql command in SQLITE3
    By karankumar1609 in forum Qt Programming
    Replies: 1
    Last Post: 30th May 2013, 11:43
  3. Replies: 1
    Last Post: 17th May 2010, 16:15
  4. How do I execute an .schema command using Qt's SQLITE driver?
    By danielperaza in forum Qt Programming
    Replies: 4
    Last Post: 5th April 2010, 20:21
  5. Ho to use signals and slots to execute a command?
    By claudio-cit in forum Qt Programming
    Replies: 2
    Last Post: 3rd July 2008, 22:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.