delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/10/20/11:49:11

Message-ID: <3BD19554.A8804CEA@yahoo.com>
From: CBFalconer <cbfalconer AT yahoo DOT com>
Organization: Ched Research
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: hwo to run prog using "program files" etc ??
References: <7se2ttccpk5u9g6223hmp6jvl9c17m15lo AT 4ax DOT com>
Lines: 34
Date: Sat, 20 Oct 2001 15:38:42 GMT
NNTP-Posting-Host: 12.90.175.97
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc06-news.ops.worldnet.att.net 1003592322 12.90.175.97 (Sat, 20 Oct 2001 15:38:42 GMT)
NNTP-Posting-Date: Sat, 20 Oct 2001 15:38:42 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Geoff Cox wrote:
> 
> I am trying to run jre.exe which is in c:\program files etc but
> following compiles OK but when runs comes up with "bad command or file
> name" under Windows 98(SE) - any suggestions please?
> 
> #include <stdio.h>
> 
> int main()
> {
> 
> char *call = "c:\\program files\\javasoft\\jre\\1.1\\bin\\jre.exe";
> system(call);
> 
> }

You have to quote it, because it contains blanks:

char *call = "\"c:\\program
files\\javasoft\\jre\\1.1\\bin\\jre.exe\"";

That error is coming from the command processor, which is trying
to execute:

   c:\program      files\javasoft\jre\1.1\bin\jre.exe

and it finds no "program" on the path.

-- 
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net)
   Available for consulting/temporary embedded and systems.
   (Remove "XXXX" from reply address. yahoo works unmodified)
   mailto:uce AT ftc DOT gov  (for spambots to harvest)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019