system ("\"C:\\Documents and Settings\\All Users\\Desktop\\Aitorg\\org\\3.bat\"");
What is wrong with this command that it doesent get executed.??
system ("\"C:\\Documents and Settings\\All Users\\Desktop\\Aitorg\\org\\3.bat\"");
What is wrong with this command that it doesent get executed.??
>What is wrong with this command that it doesent get executed.??
What does the console tell you when you try to run it? Do you get an error or does it just not do anything? Does it hang, or seem to skip the call entirely? What does the following print?
Code:cout << system ( 0 ) << '\n';
IT says cannot find the path 'C:\Documents
it is strange it worked before but when i tryed it now it doesnt (i mean the same code) i had to replace it with c:\docu~1\alluse~1\.....
WHY THAT?!
It's the nested quotes.... What you see as nested quotes, the computer sees as two pair of quotes. (A backslash in quotes, some more text, and then another set of quotes with nothing inside.)
You do need quotes around the folder names and filenames with spaces... I'm not sure about long filenames. Maybe filenames longer than the 8.3 DOS limit need quotes too. In any case, one set of quotes should do it.
>> It's the nested quotes.... What you see as nested quotes, the computer sees as two pair of quotes.
I don't think so. The \" is a single quote, since you must use that escape character to add a quote inside your string. So "\"Hello\"" in code is just "Hello" on the other end.
Maybe system just cannot handle long filenames. Also consider trying:
system ("\"C:\\Documents and Settings\\All Users\\Desktop\\Aitorg\\org\\\"3.bat");
I will assume this is windows based in which case you can do this instead:
Also in some post I did a while back you can use either / or \\ its just a matter of preferance.Code:system ("C:\\Documents and Settings\\All Users\\Desktop\\Aitorg\\org\\3.bat");