C++ path names with spaces

  Ironman556 11:25 18 May 2005

Hi, I'm trying to write a program to open a file. the file location is "C:\Program Files\MailWasher Pro\MailWasher.exe"

So far I have:

#include iostream.h>
#include iomanip.h>
#include stdlib.h>

int main (void)


system("C:\\Program Files\\MailWasher Pro\\MailWasher.exe");

return 0;


The problem I'm gettting is that when I run it I get the message 'C:\Program' is not recognised as an internal or external command, operable program or batch file. I think this is due to the spaces and I can't change the file location. Can anyone tell me what I need to do for the program to accept the space in the file name?

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

The Evil Within 2 review-in-progress

Adobe shows still-in-development tools, including automatically colourising black-and-white photos

iPhone X news: Release date, price, new features & specs

Comment transformer un iPhone en borne Wi-Fi ?