
Uwe,

 

Thank you so much for the response. I tried running the command in the format you suggested but still could not get the shell command to execute. The following is the command that I used per your suggestion and the subsequent error message.

 

shell('"C:\\programx.exe"' -import '"C:\\inputx.inp"' -run -quit)

 
#Error that is returned from above code…..
 
>'C:\Program' is not recognized as an internal or external command, operable program or >batch file.
>Warning message:
>In shell("\"C:\\programx.exe\" -import >\"C:\\input.inp\" -run -quit") :
 >'"C:\programx.exe" -import "C:\input.inp" -run -quit' execution failed with error code 1

Thinking that it may be a problem with the command line I checked with developer of the program and he said that it should be the correct language.

 

Any thoughts?

 

Thank you again,

 

Galen 

 

 
> Date: Mon, 3 May 2010 09:19:49 +0200
> From: ligges@statistik.tu-dortmund.de
> To: leavealetter1@hotmail.com
> CC: r-help@r-project.org
> Subject: Re: [R] Shell command help
> 
> 
> 
> On 02.05.2010 21:55, galen kaufman wrote:
> >
> > Dear R Community,
> >
> > I am trying to run a command line in R that will open an external program, have it import a specific input file, run the program, then close the program. The command line that I got from the developer of the model to do this looks like what you see below:
> >
> > c:\programx.exe -import 'inputx.inp' -run -quit
> >
> > I have been trying to use shell() or shell.exec() to run this in R. I can get R to open the program but I have not been able to do the rest of the steps.
> >
> > I have been able to open the model using :
> >
> >> shell('"C:\\programx.exe"')
> >
> > or
> >
> >> shell.exec("C:\\programx.exe")
> >
> > To do the rest I have been trying variations of the following:
> >
> >> shell('"C:\\programx.exe"' -import '"C:\\inputx.inp"' -run –quit)
> 
> 
> 
> Hm, you need to pass one string to the shell (and the underlking 
> system()) call:
> 
> shell('"C:\\programx.exe" -import "C:\\inputx.inp" -run –quit')
> 
> Best,
> Uwe Ligges
> 
> 
> 
> > but I am not getting anywhere.
> >
> > Can you provide any insight as to how to do the rest?
> >
> > Thank you,
> >
> > Galen 
> > _________________________________________________________________
> > Hotmail is redefining busy with tools for the New Busy. Get more from your inbox.
> >
> > N:WL:en-US:WM_HMP:042010_2
> > [[alternative HTML version deleted]]
> >
> >
> >
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
 		 	   		  
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.

ID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
	[[alternative HTML version deleted]]

