Information générale
Catégorie:
Fonctions Windows API
Have you tried launching cmd.exe instead of transman.exe? Nice for debugging things like this.
Some programs are picky about getting a fully qualified name for argv[0] (first param of CreateProcess()). Some others dislike being started from paths containing blanks unless the executable name is quoted in a certain way, because their command line parsing code is broken. Such a program would think that it resides in a folder called "c:\program" or that "program" is its own name and the path is "c:\", when it is actually located in "c:\program files\what\ever".
So you could try passing a fully qualified name as the first param for CreateProcess() but you could also pass .null. for the first parameter and build a complete command line (including the executable name) for the second parameter. Windows will do path searching for program names in the second parameter but not in the first, and it will probably supply the full path to the program even if you pass an unqualified name in the second parameter.
E.g., assuming cmd.exe is in the path but not in the current directory, RunAndWait("cmd.exe") would fail but RunAndWait(.null., "cmd.exe") would not.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement