Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to find number of internet explorer launched?

843798Jun 30 2009 — edited Jun 30 2009
Hi All,

I have been trying to get the count of the number of IE launched. I have a code to get the number of iexplore.exe processes from the task list.

Runtime runtime = Runtime.getRuntime();
String cmds[] = {"cmd", "/c", "tasklist.exe"};
Process proc = runtime.exec(cmds);
InputStream inputstream = proc.getInputStream();

InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
BufferedReader bufferedreader = new BufferedReader(inputstreamreader);
String line;
int count=1;
while ((line = bufferedreader.readLine()) != null)
{
if(line.contains("iexplore.exe"))
{

System.out.println("iExplorer" + count);
count++;
}
}

This works fine when a new window is launched by clicking the iexplore icon from the desktop. But when we click on the link from a already launched window, which causes to launch a new IE, doesnt start a new iexplore.exe process, and the above method fails.

Is there is way to get the count of number of internet explorer launched?

Any help would be greatly appericiated.

Thanks,
Sachin Johri
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2009
Added on Jun 30 2009
5 comments
190 views