I have a very strange problem with the system() function (on XP).
I have the following code:
When I run it where "A Space" is a directory with a space in the name, this is the result:
It seems that the double quotes round an argument make the parsing of the command fail.
Can anyone suggest a solution?
I have the following code:
Code:
char *text1 = "\"A Space\\Action.bat\" fred";
char *text2 = "\"A Space\\Action.bat\" \"fred\"";
int main(int argc, char *argv[]) {
printf("%s\n", text1);
system(text1);
printf("%s\n", text2);
system(text2);
return 0;
}
Code:
"A Space\Action.bat" fred
F:\Test>echo Testing
Testing
"A Space\Action.bat" "fred"
'A' is not recognized as an internal or external command,
operable program or batch file.
Can anyone suggest a solution?