heres a code snippet that should do what you are after...
public class run
{
public static void main(String[] args) throws Exception
{
Process p = Runtime.getRuntime().exec("iexplore.exe");
p.waitFor();
System.out.println("Done.");
}
}
thanks for ur reply.
i get the following exception when i run the code provided...
java.io.IOException: CreateProcess: iexplore.exe error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:428)
at java.lang.Runtime.exec(Runtime.java:364)
at java.lang.Runtime.exec(Runtime.java:326)
at Run.main(Run.java:5)
Exception in thread "main"
also, i needed a way to open exploerer to a preset directory. do i just append the directory location before the iexplore.exe ?anyone?thanks
Ok looks like this works...
public class Run {
public static void main(String[] args) throws Exception
{
Process p = Runtime.getRuntime().exec("explorer.exe THE\\PATH\\HERE");
p.waitFor();
System.out.println("Done.");
}
}
Thanks for everyones help!