windows C system call with spaces in command

Edit: OK, figured it out by stepping into the system() call: you need an extra set of quotes around the whole thing due the fact that it internally calls cmd /c yourinput

So this works for me:

system("\"\"c:\\program files\\internet explorer\\iexplore.exe\" \"www.stackoverflow.com\"\"");

A bit of a mess, isn’t it?

Leave a Comment