Message-ID: <3BD19554.A8804CEA@yahoo.com> From: CBFalconer 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 > > 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)