Results 1 to 12 of 12

Thread: Start a exe file with parameters

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2006
    Location
    Minsk, Belarus
    Posts
    33
    Thanks
    2
    Thanked 6 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Start a exe file with parameters

    Quote Originally Posted by raphaelf View Post
    but its not possible to run this psexec.exe in hide modus?
    Because when i start psexec a dos window opens..

    Its possible to hide this?
    Qt Code:
    1. QString exePath = "psexec.exe";
    2. QString arguments = "\\\\stchps426 -u etrust -p etrust01 -i \\\\stchps426\\c$\\notes.exe";
    3. #ifdef Q_OS_WIN32
    4. ShellExecuteW(NULL, NULL, (LPCWSTR)exePath.toStdWString().data(), (LPCWSTR)arguments.toStdWString().data(), NULL, SW_HIDE);
    5. #endif
    To copy to clipboard, switch view to plain text mode 


  2. #2
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Start a exe file with parameters

    I get error on compiling:

    LPCWSTR, SW_HIDE and ShellExecuteW undeclared
    Last edited by raphaelf; 16th June 2008 at 15:41.
    Think DigitalGasoline

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Start a exe file with parameters

    Quote Originally Posted by raphaelf View Post
    I get error on compiling:

    LPCWSTR, SW_HIDE and ShellExecuteW undeclared
    So include the <windows.h> (or <qt_windows.h>) header. If that's not enough, then lookup ShellExecute on MSDN to see which header file to include.
    J-P Nurmi

  4. #4
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Thumbs up Re: Start a exe file with parameters

    Hi All,

    THANK YOU VERY MUCH!!!

    SOLVED!!!
    Think DigitalGasoline

Similar Threads

  1. QtHelp Module - registering compressed help file gives error
    By Ankitha Varsha in forum Qt Programming
    Replies: 1
    Last Post: 16th May 2008, 14:14
  2. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  3. file renaming on windows
    By jdd81 in forum Qt Programming
    Replies: 9
    Last Post: 2nd October 2007, 19:41
  4. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  5. Replies: 2
    Last Post: 27th March 2007, 12:09

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
  •  
Qt is a trademark of The Qt Company.