I'm trying to run 'CreateProcess' in c, with a custom string that I build. When I'm using a simple string like:
TCHAR command[]= _T("MyApp.exe -OPTION1 -OPTION2")
Everything seems to work fine.
But as I try to build a custom string (with getting MyApp OPTIONS from an other source), and concatenate the options to the string "MyApp.exe" using sprintf_s
or swprintf_s
the string I get is the same, but the process gives me an exit code of (2) - meaning (FILE_NOT_FOUND).
I'll be grateful for any help..