General information
Category:
Windows API functions
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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only