Programmaufruf mit Parameterübergabe



  • Ich würde gerne wissen wie ich von einer C++ MFC Anwendung aus, Programme mit Parameterübergabe aufrufen kann. Als Beispiel währe der Aufruf einer einfachen Batch Datei sehr hilfreich.

    @ECHO OFF
    ECHO.
    COPY C:\OrdnerTest\%1.txt    C:\OrdnerTest\%2.txt
    ECHO.
    PAUSE
    ECHO.
    


  • Servus,

    HINSTANCE ShellExecute(          HWND hwnd,
        LPCTSTR lpOperation,
        LPCTSTR lpFile,
        LPCTSTR lpParameters,
        LPCTSTR lpDirectory,
        INT nShowCmd
    );
    

    lpFile
    [in] Pointer to a null-terminated string that specifies the file or object on which to execute the specified verb. To specify a Shell namespace object, pass the fully qualified parse name. Note that not all verbs are supported on all objects. For example, not all document types support the "print" verb.

    lpParameters
    [in] If the lpFile parameter specifies an executable file, lpParameters is a pointer to a null-terminated string that specifies the parameters to be passed to the application. The format of this string is determined by the verb that is to be invoked. If lpFile specifies a document file, lpParameters should be NULL.

    lpDirectory
    [in] Pointer to a null-terminated string that specifies the default directory.

    lpParameters musste die Parameter eintragen. Wie Shellexecute geht ist in der MSDN beschrieben

    *winke*
    Hellsgore



  • Danke Hellsgore, es hat super funktioniert!


Anmelden zum Antworten