It's fairly easy to execute a command that's in your PATH, for example, ls
Code:
import java.io.InputStream;
import java.io.IOException;
public class foo
{
public foo()
{
Runtime rt = Runtime.getRuntime();
Process p = null;
try
{
p = rt.exec( "ls -l" );
}
catch ( IOException ioe )
{
System.out.println( "Error executing file" );
}
InputStream output = p.getInputStream();
System.out.println( output );
}
public static void main( String args[] )
{
foo f = new foo();
System.exit( 0 );
}
}
Scripts are a little more work, have a look here
http://www.devx.com/tips/Tip/14667
that should help.
Peace,
ZB
http://www.zazzybob.com
EDIT: My code worked for commands, not scripts. Hay ho.