in reply to execute a file

You need to quote the filename. I can think of two ways:
# split your arguments up (recommended) system("cjpeg.exe","-gr","/program Files/Lego Mindstroms/Image0001.bmp +"); # single quote the filepath system("cjpeg.exe -gr '/program Files/Lego Mindstroms/Image0001.bmp' " +);

Read the docs here.

cLive ;-)

Update: - see Stephen's reply below. Quick note, he uses \\ in the file path because \ in a double quoted string has a special meaning and must be 'escaped'.

If you want, you can put the actual path in a single quoted string, ie:

system('C:\path\to\cjpeg.exe','-gr','C:\program Files\Lego Mindstroms\ +Image0001.bmp');

or write it in non-windows format:

system('C:/path/to/cjpeg.exe','-gr','C:/program Files/Lego Mindstroms/ +Image0001.bmp');

For more information, look up interpolation in the super search.

Another quick note, Perl seems to be rather nice as far as your directory delimiter is concerned, allowing you to use / or \ on windoze machines (AFAIK). Just remember though that \ can have special meaning.

Finally, "Mindstroms" or "Mindstorms"??? :)

Replies are listed 'Best First'.
Re: Re: execute a file
by Larinda Stone (Initiate) on Apr 13, 2001 at 04:38 UTC
    Thanks for your suggestions. I tried both of your recommendations and I am still receiving the error. Can you think of something else?