I was trying to make a simple (small as possible!) program that would run the arguments as a command line with system()
For example:
starter.exe notepad.exe c:\boot.ini
would preform the same action as:
Expand|Select|Wrap|Line Numbers
- system("start notepad.exe c:\boot.ini");
However I can't seem to figure out how to get the 2d array given to main() into one big array (one entry after another - think argv[n] + argv[n+1] + arg[n+2] and so on. The most I can do is get the first "argument" (in reality I want EVERYTHING after my .exe to be one argument) to system().
system() wants a char array, so strings are out (as far as I understand - very little). It also most definatly doesn't want an array of char arrays.
Really I want to take each element of argv[] and put them into a 1-dimensional char array one after the other (inserting the spaces that get removed when the OS does it's voodoo to the arguments), call it argx, and use system("start " + argx); (providing system() doesn't barf at that syntax)
The reasoning behind this requirement is I'm trying to run a large .NET program from within a legacy DOS program with very limited resources (using "start" doesn't work, but using an additional intermediary gets around the problem.)