I want to call the code inside my code with the parameters set within my code.
I'm not looking to call any external functions or method, but in a real .xe or batch / script file in the WinXP environment.
C or C ++ will be the preferred language, but if it is done more easily I know in any other language (ASM, C #, Python, etc.).
When you call the process (), system (), etc., make sure you enter the file name string Repeat the command program with the filename), if your file name (s) and / or have a blank space near the fully qualified path, otherwise the path of the file name will be parsed as a different argument by the command interpreter.
System ("\" d: some path \\ program.exe \ "\" d: \\ other path \\ file name .ext \ "");
For Windows it is recommended to create CreateProcess (). It has Messier setup but you have more control over how processes are started (as described by Greg Hagil). For quick and dirty, you can also use WinExec () (the system is portable for Unix).
When launching batch files you can use CMD.XA (or Command.com) There may be a need to launch with.
WinExec ("CMD \" d: some path \\ program.bat \ "\" d: \\ other path \\ file name .ext \ "", SW_SHOW_MINIMIZED);
(or SW_SHOW_NORMAL
if you want to show the command window).
Windows should get command command or CMD.XA in the system. The path should not be fully qualified, but if you want to ensure that you are fully qualified file name (only C: \ Windows \ System32 \ cmd.exe).
Comments
Post a Comment