We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › execute shell command in processing
Page Index Toggle Pages: 1
execute shell command in processing (Read 1102 times)
execute shell command in processing
Apr 8th, 2009, 2:51pm
 
How can I execute a linux shell command in processing?
I was going to write an my app in java but I can do it much faster in processing without having to wrangle eclipse's visual editor and swing.

The only thing delaying me is the ability to execute something like:
"exaile --play"

thanks
Re: execute shell command in processing
Reply #1 - Apr 8th, 2009, 3:17pm
 
See open()
Re: execute shell command in processing
Reply #2 - Apr 8th, 2009, 4:36pm
 
Thanks PhiLho,
If you had a nickel for everytime you answered one of my questions...
...well u might have like only a or so dollar...
but anyways thanks!
Re: execute shell command in processing
Reply #3 - May 2nd, 2009, 9:02pm
 
I'm trying to use open() to launch a batch file and I can't get it to work, it may have something to do with the fact that I'm on a vista machine but I dunno I'm tapped for ideas, it will open a windows app like notepad but not a bat file?
Re: execute shell command in processing
Reply #4 - May 3rd, 2009, 1:23am
 
I haven't tried, but you might want to open cmd.exe with /c option and the .bat name as argument.
Re: execute shell command in processing
Reply #5 - May 3rd, 2009, 4:33pm
 
Thanks PhiLho,
but that didn't work either Sad
...I think I may be able to kludge a solution by writing a C++ .exe that opens the .bat file though, we'll see if that works
Re: execute shell command in processing
Reply #6 - May 3rd, 2009, 5:31pm
 
Okay, making the .exe didnt work but strangely the .bat file started working, not sure why but at least the batchfile works, but check this out:
If I try Running:
Code:
open("E:/SOFTWARE/PROCESSING/Processing/blank/data/test.exe");  


It did not work but:
Code:
open("E:/SOFTWARE/PROCESSING/Processing/blank/data/test.bat"); 


did work, whats also weird is that at the command line I can do:

Code:
cmd /c E:/SOFTWARE/PROCESSING/Processing/blank/data/test.exe
or
Code:
cmd /c E:/SOFTWARE/PROCESSING/Processing/blank/data/test.bat
and they both work?

Re: execute shell command in processing
Reply #7 - May 19th, 2009, 11:48am
 
This has proven useful to me:

open("rundll32 SHELL32.DLL,ShellExec_RunDLL " + "file.bat");




Page Index Toggle Pages: 1