How to find number of internet explorer launched?
843798Jun 30 2009 — edited Jun 30 2009Hi 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