Can anyone make the following run?
public class ExecTest {
public static void main(String[] args) {
try {
//Notice the multiple spaces in the arg
Use new File(pathName).canExecute()
first to check whether it's executable or not
EDIT:
public static void runAll(String... cmd)
{
for(String s : cmd)
{
try
{
Runtime.getRuntime().exec(cmd);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
and then you can use it like: runAll("explorer.exe", "taskmgr.exe");