hello ,
first i want to say that im very new at c++ , i managed to create a very simple program through searching the internet , this little program involves running a certain exe file with parameters :
(e.g: "c:\folder\file.exe" -parameter1 -parameter2)
i am using the system() function to do that so my code looks something like
string x;
x = "\"c:\\folder\\file.exe\" -parameter1:value1 -parameter2:value2";
system(x.c_str());
so it would run this command ( "c:\folder\file.exe" -parameter1:value1 -parameter2:value2 )
it works fine untill one of the parameters values must include quotes in it like this ( -parameter:"value" )
so when i type the code like this
string x;
x = "\"c:\\folder\\file.exe\" -parameter1:\"value1\"";
system(x.c_str());
i get the error :
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
but if i put the same command line ( with the quoted value of the parameter ) in the windows run , or in CMD , it would work fine, why do i get the error when i try to run it from the system() function ..?!!
i appereciate any help.