T
tom_kuehnert
Hi!
I'm trying to execute a program using system(). The program itself is
located in some path which might contain whitespaces.
Simple solution would be this:
system("\"C:\A B\C.exe\"");
but now this program also has parameters which need to be passed
(again with paths containing whitepaces)
I tried putting all paths in double quotes:
system("\"C:\A B\C.exe\" -a \"C:\A B\D.txt\"");
But it refuses to execute since "C:\A" is not a valid path.
Has anyone got an idea why this happens? Can I use single quotes
somehow to avoid this problem?
My guess is that system() just passes the whole line to cmd.exe as
parameter, putting the whole line in quotes. This then results in my
quotes closing those "too early".
I'd appreciate any help
Tom
PS: using VS005
I'm trying to execute a program using system(). The program itself is
located in some path which might contain whitespaces.
Simple solution would be this:
system("\"C:\A B\C.exe\"");
but now this program also has parameters which need to be passed
(again with paths containing whitepaces)
I tried putting all paths in double quotes:
system("\"C:\A B\C.exe\" -a \"C:\A B\D.txt\"");
But it refuses to execute since "C:\A" is not a valid path.
Has anyone got an idea why this happens? Can I use single quotes
somehow to avoid this problem?
My guess is that system() just passes the whole line to cmd.exe as
parameter, putting the whole line in quotes. This then results in my
quotes closing those "too early".
I'd appreciate any help
Tom
PS: using VS005