?
Solved

how to use WMI/WScript GetObject to get a particular instance of IE created with CreateObject

Posted on 2007-10-08
5
Medium Priority
?
2,760 Views
Last Modified: 2008-01-09
Hello Experts:

I am working on an hta file that calls code in a .js file that creates an ie object.  The code in the java script file is:
function OpenMPS()
{
  objExplorer = WScript.CreateObject("InternetExplorer.Application");
  objExplorer.Visible = 1;
  objExplorer.Navigate (MPS_URL);

  WScript.Sleep (1000);
  objShell.AppActivate ("Mobile Workload - Microsoft Internet Explorer");
}

Now, in the .hta file that is supposed to manage and be the 'homepage' for this application has this code to call the .js file:
function launchMPS()
{
      var shell = new ActiveXObject( "WScript.Shell" );
    if( pMPSWorkload == null)
    {
      pMPSWorkload = shell.run( "WScript D:/mps/mps.js", 1, true );
      }  
}

I think I need to use GetObject sort of like this:
function GetJBossService()
{
  var colListOfServices = objWMIService.ExecQuery ("Select * from Win32_Service Where Name = 'JBoss'");
  var enumItems = new Enumerator (colListOfServices);
  for (;!enumItems.atEnd(); enumItems.moveNext())
  {
    objJBossService = enumItems.item();
  }
}
However, the ie instance does not show up in Services, and I do not know what to query to look for it.  I have found some examples with Excel, and they query Win32LogicalDisk.  The examples always start out saying that GetObject in VB is similar and then go into an explanation of how to use VB as "you will probably not need to EVER use WMI....    but I cannot use VB!

Please help!  any info will be greatly appreciated!
Myra :):)
0
Comment
Question by:mdolle
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20054969
Hi,

I will try to help a little, however I am not familiar with what you are trying to do.

In the script sniplets you show, I do not see where you define objWMIService

I see on the net something like this:

' WhoLogon.vbs
' Sample VBScript to discover which user is logged on
' Author Guy Thomas http://computerperformance.co.uk/
' Version 1.2 - December 2005
' --------------------------------------------------------------'
Option Explicit
Dim objWMIService, objComputer, colComputer, strComputer

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")

For Each objComputer in colComputer
Wscript.Echo objComputer.UserName & " is logged on"
Next

' End of Sample Script. Who is logged on?


which might translate to

var strComputer = "."
var objWMIService = WScript.GetObject("winmgmts: {impersonationLevel=impersonate}!\\" +
strComputer + "\root\cimv2")


I also do not see you define your variables globally, e.g. outside the functions
That might not be a problem since IE assigns them to window., but I would feel safer if you had


var objExplorer = null; // define objExplorer globally
function OpenMPS()
{
  objExplorer = WScript.CreateObject("InternetExplorer.Application");
  objExplorer.Visible = 1;
  objExplorer.Navigate (MPS_URL);
  WScript.Sleep (1000);
  objShell.AppActivate ("Mobile Workload - Microsoft Internet Explorer");
}


It is a little hard to help with only sniplets, but since I do not have your setup anyway, I am not sure it would help to see all code.

You can install the debugger, which might help by pointing at missing objects or syntax errors:

It should be here
http://msdn2.microsoft.com/en-us/library/ms950396.aspx

but gives a 404.

I found one here, but I am not guaranteeing it is the right one to use
http://www.microsoft.com/downloads/details.aspx?FamilyID=2F465BE0-94FD-4569-B3C4-DFFDF19CCD99&displaylang=en
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20055167
I btw found some JS for a previous question of yours
How to find browser windows
here http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1172493&SiteID=1

var objShell = new ActiveXObject("Shell.Application");
var objShellWindows;
       
objShellWindows = objShell.Windows();
if (objShellWindows != null) {
  var objIE;
  for (var i = 0; i < objShellWindows.Count; i++) {
    objIE = objShellWindows.Item(i);
    if (objIE) {
      WScript.Echo(objIE.LocationURL);
    }
  }
}

Same article tells us that VISTA may hide the browser from the script
0
 

Author Comment

by:mdolle
ID: 20058339
Hello, thank you for all of your help.  It will probably take me the rest of the day to work on your suggestions I do think that may be what I need.  I am posting the entire hta and .js files in case you want to see them it may clear up some of what I was trying to ask.

mps.js:

var objJBossService;
var objRemoteDBService;
var objWMIService;
var objShell;
var RESTART_TIME = 55;
var MPS_URL = "http://localhost/workload/AssignedWorkload/displayAssignedWorkload";



try
{
  objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2");
  objShell = WScript.CreateObject("Wscript.Shell");
  GetJBossService();
  GetRemoteDBService();

  if (objJBossService.State!="Running" || objRemoteDBService.State!="Running")
  {
    if( workloadOpened == 0 )
    {
       StartMPS();
       workloadOpened = 1;
    }
  }
  else
  {
    OpenMPS();
  }
}
catch (er)
{
  // do nothing
}

/*
* Function sets the global variable objJBossService so the JBoss service can be manipulated
*/
function GetJBossService()
{
  var colListOfServices = objWMIService.ExecQuery ("Select * from Win32_Service Where Name = 'JBoss'");
 
  var enumItems = new Enumerator (colListOfServices);
  for (;!enumItems.atEnd(); enumItems.moveNext())
  {
    objJBossService = enumItems.item();
  }

}
/*
* Function sets the global variable objRemoteDBService so the remotedb service can be manipulated
*/
function GetRemoteDBService()
{

  var colListOfServices = objWMIService.ExecQuery ("Select * from Win32_Service Where Name = 'ASANYe_remotedb'");

  var enumItems = new Enumerator (colListOfServices);
  for (;!enumItems.atEnd(); enumItems.moveNext())
  {
    objRemoteDBService = enumItems.item();
  }
}

/*
* Function shutsdown both services and restarts them while displaying status on a web page
*/
function StartMPS()
{
  objExplorer = WScript.CreateObject("InternetExplorer.Application");
  objExplorer.Navigate ("D:\\MPS\\MPSStart.htm");
  while (objExplorer.Busy)
  {
    WScript.Sleep (200);
  }


  objExplorer.Visible = 1;
  objShell.AppActivate ("MPS Start Page - Microsoft Internet Explorer");
  WScript.Sleep (2000);
  //objExplorer.document.body.innerHTML = "Stopping JBoss ...";
  objJBossService.StopService();
  WScript.Sleep (5000);
  //objExplorer.document.body.innerHTML = "Stopping MPS Database ...";
  objRemoteDBService.StopService();
  WScript.Sleep (5000);
  //objExplorer.document.body.innerHTML = "Re-starting MPS Database ...";
  objRemoteDBService.StartService();
  WScript.Sleep (5000);
  //objExplorer.document.body.innerHTML = "Re-starting JBoss ...";
  objJBossService.StartService();
  WScript.Sleep (5000);
 
  GetJBossService();
  GetRemoteDBService();
   
  if (objJBossService.State!="Running" || objRemoteDBService.State!="Running")
  {
      objExplorer.document.body.innerHTML = "MPS could not be restarted.  Please contact the CSC.";
  }
  else
  {

    for (var i=0;i< RESTART_TIME ;i++)
    {
      objExplorer.document.body.innerHTML = "MPS is restarting...<br> The MPS Workload will open in " + (RESTART_TIME-i) +
                " seconds. <br><br>  <span style=\"color:red\">Do not close this window while MPS is restarting.<span>";
      WScript.Sleep (1000);
    }
    objExplorer.document.body.innerHTML = "Opening MPS Workload ...";
    objExplorer.Navigate (MPS_URL);
  }
}

function OpenMPS()
{
  objExplorer = WScript.CreateObject("InternetExplorer.Application");
  objExplorer.Visible = 1;
  objExplorer.Navigate (MPS_URL);

  WScript.Sleep (1000);
  objShell.AppActivate ("Mobile Workload - Microsoft Internet Explorer");
}

index.hta -- keeps changing due to trying to fix the problem


<html>
<head>
<!-- SIR 24382 SAM 06/20/06- Added the environment with the version number 3.4 -->
<!-- SIR 24480 SAM 06/28/06- Update configuration and images for the next release of MPS 4.0 -->
<!-- SIR 24543 SAM 10/25/06- Update configuration and images for the next release of MPS 4.1 -->
<!-- SIR 24857 MMD 03/14/07- Update configuration and images for the next release of MPS 4.3 -->
<!-- SIR 25357 Lavanya 05/25/07- Update configuration and images for the next release of MPS 4.4 -->
<!-- SIR 24857 MMD 10/05/07- Update configuration and images for the next release of MPS 5.0 -->
  <title>Mobile Protective Services 5.0 Homepage</title>
  <HTA:APPLICATION ID="MPS_Homepage"
                   APPLICATIONNAME="MPS"
                   border="thin"
                   borderStyle="normal"
                   caption="yes"
                   icon="favicon.ico"
                   showInTaskbar="yes"
                   windowState="maximize"
                   innerBorder="no"
                   navigable="no"
                   scroll="no"
                   scrollFlat="yes"
                   singleInstance="yes"
                   sysMenu="yes"
                   contextMenu="yes"
                   selection="yes"
                   version="1.0"/>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <!-- ImageReady Preload Script (MPS_Portal_Tablet_Size.psd) -->
  <script type="text/javascript">
<!--

function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}

function changeImages() {
  if (document.images && (preloadFlag == true)) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    }
  }
}

var preloadFlag = false;
function preloadImages() {
  if (document.images) {
    MPS_HomePage_MPS_Key_over = newImage("images/MPS_HomePage_MPS-Key-over.gif");
    MPS_HomePage_MPS_Key_down = newImage("images/MPS_HomePage_MPS-Key-down.gif");
    MPS_HomePage_MPS_Key_over009 = newImage("images/MPS_HomePage_MPS-Key-ove-09.gif");
    MPS_HomePage_MPS_Key_down010 = newImage("images/MPS_HomePage_MPS-Key-dow-10.gif");
    MPS_HomePage_IMPACT_Key_over = newImage("images/MPS_HomePage_IMPACT-Key-ove.gif");
    MPS_HomePage_IMPACT_Key_down = newImage("images/MPS_HomePage_IMPACT-Key-dow.gif");
    MPS_HomePage_IMPACT_Key_over017 = newImage("images/MPS_HomePage_IMPACT-Key--17.gif");
    MPS_HomePage_IMPACT_Key_down018 = newImage("images/MPS_HomePage_IMPACT-Key--18.gif");
    MPS_HomePage_My_Notepad_Key_over = newImage("images/MPS_HomePage_My-Notepad--20.gif");
    MPS_HomePage_My_Notepad_Key_down = newImage("images/MPS_HomePage_My-Notepad--21.gif");
    MPS_HomePage_My_Notepad_Key_over025 = newImage("images/MPS_HomePage_My-Notepad--25.gif");
    MPS_HomePage_My_Notepad_Key_down026 = newImage("images/MPS_HomePage_My-Notepad--26.gif");
    MPS_HomePage_Streets___Trips_Key_over = newImage("images/MPS_HomePage_Streets-%26-T-28.gif");
    MPS_HomePage_Streets___Trips_Key_down = newImage("images/MPS_HomePage_Streets-%26-T-29.gif");
    MPS_HomePage_e_mail_Key_over = newImage("images/MPS_HomePage_e-mail-Key-ove.gif");
    MPS_HomePage_e_mail_Key_down = newImage("images/MPS_HomePage_e-mail-Key-dow.gif");
    MPS_HomePage_Handbook_Key_over = newImage("images/MPS_HomePage_Handbook-Key-o.gif");
    MPS_HomePage_Handbook_Key_down = newImage("images/MPS_HomePage_Handbook-Key-d.gif");
    MPS_HomePage_e_mail_Key_over044 = newImage("images/MPS_HomePage_e-mail-Key--44.gif");
    MPS_HomePage_e_mail_Key_down045 = newImage("images/MPS_HomePage_e-mail-Key--45.gif");
    MPS_HomePage_Forms_Key_over = newImage("images/MPS_HomePage_Forms-Key-over.gif");
    MPS_HomePage_Forms_Key_down = newImage("images/MPS_HomePage_Forms-Key-down.gif");
    MPS_HomePage_Handbook_Key_over052 = newImage("images/MPS_HomePage_Handbook-Ke-52.gif");
    MPS_HomePage_Handbook_Key_down053 = newImage("images/MPS_HomePage_Handbook-Ke-53.gif");
    MPS_HomePage_My_PC_Key_over = newImage("images/MPS_HomePage_My-PC-Key-over.gif");
    MPS_HomePage_My_PC_Key_down = newImage("images/MPS_HomePage_My-PC-Key-down.gif");
    preloadFlag = true;
  }
}


var pOutlook = null;
function launchOutlook()
{
  var shell = new ActiveXObject( "WScript.Shell" );

  if( pOutlook == null || pOutlook.Status == 1 )
  {
    pOutlook = shell.Exec( "C:/Program Files/Microsoft Office/OFFICE11/outlook.exe" );
  }
  else
  {
    shell.AppActivate( pOutlook.ProcessID );
    shell.SendKeys("% x");
  }
}

var pJournal = null;
function launchJournal()
{
  var shell = new ActiveXObject( "WScript.Shell" );

  if( pJournal == null || pJournal.Status == 1 )
  {
    pJournal = shell.Exec( "C:/Program Files/Windows Journal/Journal.exe" );
  }
  else
  {
    shell.AppActivate( pJournal.ProcessID );
    shell.SendKeys("% x");
  }
}

var pStreets = null;
function launchStreets()
{
  var shell = new ActiveXObject( "WScript.Shell" );

  if( pStreets == null || pStreets.Status == 1 )
  {
    pStreets = shell.Exec( "D:/Program Files/Microsoft Streets and Trips/streets.exe" );
  }
  else
  {
    shell.AppActivate( pStreets.ProcessID );
    shell.SendKeys("% x");
  }
}

function launchMPS()
{
// THESE 2 LINES ARE THE ORIGINAL CODE I NEED TO EDIT
 // var shell = new ActiveXObject( "WScript.Shell" );
  //shell.Exec( "WScript D:/mps/mps.js" );

//  currently I have
objIE = new ActiveXObject("InternetExplorer.Application");
objIE.Visible = 0; // want it visible depending upon conditions
objIE.Navigate(MPS_URL);  // HERE IS PART OF THE PROBLEM, this is fine first time through, but
                                          // subsequent times need to go to URL that user has navigated too

doc = objIE.document;
mtags = doc.getElementsByTagName("META");
if(mtags[1].content == "true")  // this is not all the conditions I need
  objIE.Navigate(doc.title); // this does not work, and is always the MPS_URL
 objIE.Visible = 1;
}
//then here I was using AppActivate but I dont have access to WScript in the .hta?



// -->
</script>
<!-- End Preload Script -->


</head>
<body bgcolor="#83CEF8" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="preloadImages();">
<!-- ImageReady Slices (MPS_HomePage.psd) -->
<table id="Table_01" width="1025" height="751" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="17">
      <img src="images/MPS_HomePage_01.gif" width="1024" height="83" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="83" alt=""></td>
  </tr>
  <tr>
    <td rowspan="16">
      <img src="images/MPS_HomePage_02.gif" width="376" height="667" alt=""></td>
    <td colspan="11">
      <a href="#"
        onclick="launchMPS()"
        onmouseover="changeImages('MPS_HomePage_MPS_Key', 'images/MPS_HomePage_MPS-Key-over.gif', 'MPS_HomePage_MPS_Key008', 'images/MPS_HomePage_MPS-Key-ove-09.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_MPS_Key', 'images/MPS_HomePage_MPS-Key.gif', 'MPS_HomePage_MPS_Key008', 'images/MPS_HomePage_MPS-Key-08.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_MPS_Key', 'images/MPS_HomePage_MPS-Key-down.gif', 'MPS_HomePage_MPS_Key008', 'images/MPS_HomePage_MPS-Key-dow-10.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_MPS_Key', 'images/MPS_HomePage_MPS-Key-over.gif', 'MPS_HomePage_MPS_Key008', 'images/MPS_HomePage_MPS-Key-ove-09.gif'); return true;">
        <img name="MPS_HomePage_MPS_Key" src="images/MPS_HomePage_MPS-Key.gif" width="402" height="59" border="0" alt=""></a></td>
    <td colspan="5">
      <img src="images/MPS_HomePage_04.gif" width="246" height="59" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="59" alt=""></td>
  </tr>
  <tr>
    <td colspan="2">
      <a href="#"
        onmouseover="changeImages('MPS_HomePage_MPS_Key', 'images/MPS_HomePage_MPS-Key-over.gif', 'MPS_HomePage_MPS_Key008', 'images/MPS_HomePage_MPS-Key-ove-09.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_MPS_Key', 'images/MPS_HomePage_MPS-Key.gif', 'MPS_HomePage_MPS_Key008', 'images/MPS_HomePage_MPS-Key-08.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_MPS_Key', 'images/MPS_HomePage_MPS-Key-down.gif', 'MPS_HomePage_MPS_Key008', 'images/MPS_HomePage_MPS-Key-dow-10.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_MPS_Key', 'images/MPS_HomePage_MPS-Key-over.gif', 'MPS_HomePage_MPS_Key008', 'images/MPS_HomePage_MPS-Key-ove-09.gif'); return true;">
        <img name="MPS_HomePage_MPS_Key008" src="images/MPS_HomePage_MPS-Key-08.gif" width="80" height="3" border="0" alt=""></a></td>
    <td colspan="11" rowspan="2">
          <a href="http://impact/login/Login/"
        target="_blank"
        onmouseover="changeImages('MPS_HomePage_IMPACT_Key', 'images/MPS_HomePage_IMPACT-Key-ove.gif', 'MPS_HomePage_IMPACT_Key016', 'images/MPS_HomePage_IMPACT-Key--17.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_IMPACT_Key', 'images/MPS_HomePage_IMPACT-Key.gif', 'MPS_HomePage_IMPACT_Key016', 'images/MPS_HomePage_IMPACT-Key-16.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_IMPACT_Key', 'images/MPS_HomePage_IMPACT-Key-dow.gif', 'MPS_HomePage_IMPACT_Key016', 'images/MPS_HomePage_IMPACT-Key--18.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_IMPACT_Key', 'images/MPS_HomePage_IMPACT-Key-ove.gif', 'MPS_HomePage_IMPACT_Key016', 'images/MPS_HomePage_IMPACT-Key--17.gif'); return true;">
        <img name="MPS_HomePage_IMPACT_Key" src="images/MPS_HomePage_IMPACT-Key.gif" width="336" height="59" border="0" alt=""></a></td>
    <td colspan="3" rowspan="2">
      <img src="images/MPS_HomePage_07.gif" width="232" height="59" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="3" alt=""></td>
  </tr>
  <tr>
    <td colspan="2" rowspan="11">
      <img src="images/MPS_HomePage_08.gif" width="80" height="357" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="56" alt=""></td>
  </tr>
  <tr>
    <td colspan="2">
      <a href="#"
        onmouseover="changeImages('MPS_HomePage_IMPACT_Key', 'images/MPS_HomePage_IMPACT-Key-ove.gif', 'MPS_HomePage_IMPACT_Key016', 'images/MPS_HomePage_IMPACT-Key--17.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_IMPACT_Key', 'images/MPS_HomePage_IMPACT-Key.gif', 'MPS_HomePage_IMPACT_Key016', 'images/MPS_HomePage_IMPACT-Key-16.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_IMPACT_Key', 'images/MPS_HomePage_IMPACT-Key-dow.gif', 'MPS_HomePage_IMPACT_Key016', 'images/MPS_HomePage_IMPACT-Key--18.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_IMPACT_Key', 'images/MPS_HomePage_IMPACT-Key-ove.gif', 'MPS_HomePage_IMPACT_Key016', 'images/MPS_HomePage_IMPACT-Key--17.gif'); return true;">
        <img name="MPS_HomePage_IMPACT_Key016" src="images/MPS_HomePage_IMPACT-Key-16.gif" width="42" height="3" border="0" alt=""></a></td>
    <td colspan="10" rowspan="2">
      <a href="#"
              onclick="launchJournal()"
        onmouseover="changeImages('MPS_HomePage_My_Notepad_Key', 'images/MPS_HomePage_My-Notepad--20.gif', 'MPS_HomePage_My_Notepad_Key024', 'images/MPS_HomePage_My-Notepad--25.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_My_Notepad_Key', 'images/MPS_HomePage_My-Notepad-Key.gif', 'MPS_HomePage_My_Notepad_Key024', 'images/MPS_HomePage_My-Notepad--24.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_My_Notepad_Key', 'images/MPS_HomePage_My-Notepad--21.gif', 'MPS_HomePage_My_Notepad_Key024', 'images/MPS_HomePage_My-Notepad--26.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_My_Notepad_Key', 'images/MPS_HomePage_My-Notepad--20.gif', 'MPS_HomePage_My_Notepad_Key024', 'images/MPS_HomePage_My-Notepad--25.gif'); return true;">
        <img name="MPS_HomePage_My_Notepad_Key" src="images/MPS_HomePage_My-Notepad-Key.gif" width="296" height="59" border="0" alt=""></a></td>
    <td colspan="2" rowspan="2">
      <img src="images/MPS_HomePage_11.gif" width="230" height="59" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="3" alt=""></td>
  </tr>
  <tr>
    <td colspan="2" rowspan="7">
      <img src="images/MPS_HomePage_12.gif" width="42" height="237" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="56" alt=""></td>
  </tr>
  <tr>
    <td colspan="2">
      <a href="#"
        onmouseover="changeImages('MPS_HomePage_My_Notepad_Key', 'images/MPS_HomePage_My-Notepad--20.gif', 'MPS_HomePage_My_Notepad_Key024', 'images/MPS_HomePage_My-Notepad--25.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_My_Notepad_Key', 'images/MPS_HomePage_My-Notepad-Key.gif', 'MPS_HomePage_My_Notepad_Key024', 'images/MPS_HomePage_My-Notepad--24.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_My_Notepad_Key', 'images/MPS_HomePage_My-Notepad--21.gif', 'MPS_HomePage_My_Notepad_Key024', 'images/MPS_HomePage_My-Notepad--26.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_My_Notepad_Key', 'images/MPS_HomePage_My-Notepad--20.gif', 'MPS_HomePage_My_Notepad_Key024', 'images/MPS_HomePage_My-Notepad--25.gif'); return true;">
        <img name="MPS_HomePage_My_Notepad_Key024" src="images/MPS_HomePage_My-Notepad--24.gif" width="22" height="3" border="0" alt=""></a></td>
    <td colspan="9" rowspan="2">
      <a href="#"
              onclick="launchStreets()"
        onmouseover="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-T-28.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-Trip.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-T-29.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-T-28.gif'); return true;">
        <img name="MPS_HomePage_Streets___Trips_Key" src="images/MPS_HomePage_Streets-%26-Trip.gif" width="275" height="60" border="0" alt=""></a></td>
    <td rowspan="11">
      <img src="images/MPS_HomePage_15.gif" width="229" height="490" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="3" alt=""></td>
  </tr>
  <tr>
    <td colspan="2" rowspan="3">
      <img src="images/MPS_HomePage_16.gif" width="22" height="117" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="57" alt=""></td>
  </tr>
  <tr>
    <td>
      <a href="#"
        onmouseover="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-T-28.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-Trip.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-T-29.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-T-28.gif'); return true;">
        <img src="images/MPS_HomePage_Streets-%26-T-32.gif" width="2" height="2" border="0" alt=""></a></td>
    <td colspan="5" rowspan="2">
      <a href="#"
              onclick="launchOutlook()"
        onmouseover="changeImages('MPS_HomePage_e_mail_Key', 'images/MPS_HomePage_e-mail-Key-ove.gif', 'MPS_HomePage_e_mail_Key043', 'images/MPS_HomePage_e-mail-Key--44.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_e_mail_Key', 'images/MPS_HomePage_e-mail-Key.gif', 'MPS_HomePage_e_mail_Key043', 'images/MPS_HomePage_e-mail-Key-43.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_e_mail_Key', 'images/MPS_HomePage_e-mail-Key-dow.gif', 'MPS_HomePage_e_mail_Key043', 'images/MPS_HomePage_e-mail-Key--45.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_e_mail_Key', 'images/MPS_HomePage_e-mail-Key-ove.gif', 'MPS_HomePage_e_mail_Key043', 'images/MPS_HomePage_e-mail-Key--44.gif'); return true;">
                                <img name="MPS_HomePage_e_mail_Key" src="images/MPS_HomePage_e-mail-Key.gif" width="267" height="60" border="0" alt=""></a></td>
    <td colspan="3">
      <a href="#"
        onmouseover="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-T-28.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-Trip.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-T-29.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_Streets___Trips_Key', 'images/MPS_HomePage_Streets-%26-T-28.gif'); return true;">
        <img src="images/MPS_HomePage_Streets-%26-T-36.gif" width="6" height="2" border="0" alt=""></a></td>
    <td>
      <img src="images/spacer.gif" width="1" height="2" alt=""></td>
  </tr>
  <tr>
    <td>
      <img src="images/MPS_HomePage_20.gif" width="2" height="58" alt=""></td>
    <td colspan="3" rowspan="8">
      <img src="images/MPS_HomePage_21.gif" width="6" height="428" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="58" alt=""></td>
  </tr>
  <tr>
    <td rowspan="2">
      <img src="images/MPS_HomePage_22.gif" width="4" height="61" alt=""></td>
    <td colspan="5" rowspan="2">
      <a href="http://localhost/handbooks"
              target="_blank"
        onmouseover="changeImages('MPS_HomePage_Handbook_Key', 'images/MPS_HomePage_Handbook-Key-o.gif', 'MPS_HomePage_Handbook_Key051', 'images/MPS_HomePage_Handbook-Ke-52.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_Handbook_Key', 'images/MPS_HomePage_Handbook-Key.gif', 'MPS_HomePage_Handbook_Key051', 'images/MPS_HomePage_Handbook-Ke-51.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_Handbook_Key', 'images/MPS_HomePage_Handbook-Key-d.gif', 'MPS_HomePage_Handbook_Key051', 'images/MPS_HomePage_Handbook-Ke-53.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_Handbook_Key', 'images/MPS_HomePage_Handbook-Key-o.gif', 'MPS_HomePage_Handbook_Key051', 'images/MPS_HomePage_Handbook-Ke-52.gif'); return true;">
        <img name="MPS_HomePage_Handbook_Key" src="images/MPS_HomePage_Handbook-Key.gif" width="268" height="61" border="0" alt=""></a></td>
    <td colspan="2">
      <a href="#"
        onmouseover="changeImages('MPS_HomePage_e_mail_Key', 'images/MPS_HomePage_e-mail-Key-ove.gif', 'MPS_HomePage_e_mail_Key043', 'images/MPS_HomePage_e-mail-Key--44.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_e_mail_Key', 'images/MPS_HomePage_e-mail-Key.gif', 'MPS_HomePage_e_mail_Key043', 'images/MPS_HomePage_e-mail-Key-43.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_e_mail_Key', 'images/MPS_HomePage_e-mail-Key-dow.gif', 'MPS_HomePage_e_mail_Key043', 'images/MPS_HomePage_e-mail-Key--45.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_e_mail_Key', 'images/MPS_HomePage_e-mail-Key-ove.gif', 'MPS_HomePage_e_mail_Key043', 'images/MPS_HomePage_e-mail-Key--44.gif'); return true;">
        <img name="MPS_HomePage_e_mail_Key043" src="images/MPS_HomePage_e-mail-Key-43.gif" width="19" height="2" border="0" alt=""></a></td>
    <td>
      <img src="images/spacer.gif" width="1" height="2" alt=""></td>
  </tr>
  <tr>
    <td colspan="2" rowspan="6">
      <img src="images/MPS_HomePage_25.gif" width="19" height="368" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="59" alt=""></td>
  </tr>
  <tr>
    <td rowspan="2">
      <img src="images/MPS_HomePage_26.gif" width="7" height="61" alt=""></td>
    <td colspan="6" rowspan="2">
      <a href="#"
        onmouseover="changeImages('MPS_HomePage_Forms_Key', 'images/MPS_HomePage_Forms-Key-over.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_Forms_Key', 'images/MPS_HomePage_Forms-Key.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_Forms_Key', 'images/MPS_HomePage_Forms-Key-down.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_Forms_Key', 'images/MPS_HomePage_Forms-Key-over.gif'); return true;">
        <img name="MPS_HomePage_Forms_Key" src="images/MPS_HomePage_Forms-Key.gif" width="274" height="61" border="0" alt=""></a></td>
    <td>
      <a href="#"
        onmouseover="changeImages('MPS_HomePage_Handbook_Key', 'images/MPS_HomePage_Handbook-Key-o.gif', 'MPS_HomePage_Handbook_Key051', 'images/MPS_HomePage_Handbook-Ke-52.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_Handbook_Key', 'images/MPS_HomePage_Handbook-Key.gif', 'MPS_HomePage_Handbook_Key051', 'images/MPS_HomePage_Handbook-Ke-51.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_Handbook_Key', 'images/MPS_HomePage_Handbook-Key-d.gif', 'MPS_HomePage_Handbook_Key051', 'images/MPS_HomePage_Handbook-Ke-53.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_Handbook_Key', 'images/MPS_HomePage_Handbook-Key-o.gif', 'MPS_HomePage_Handbook_Key051', 'images/MPS_HomePage_Handbook-Ke-52.gif'); return true;">
        <img name="MPS_HomePage_Handbook_Key051" src="images/MPS_HomePage_Handbook-Ke-51.gif" width="33" height="2" border="0" alt=""></a></td>
    <td>
      <img src="images/spacer.gif" width="1" height="2" alt=""></td>
  </tr>
  <tr>
    <td rowspan="4">
      <img src="images/MPS_HomePage_29.gif" width="33" height="307" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="59" alt=""></td>
  </tr>
  <tr>
    <td rowspan="3">
      <img src="images/MPS_HomePage_30.gif" width="12" height="248" alt=""></td>
    <td colspan="7" rowspan="2">
      <a href="#"
        onmouseover="changeImages('MPS_HomePage_My_PC_Key', 'images/MPS_HomePage_My-PC-Key-over.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_My_PC_Key', 'images/MPS_HomePage_My-PC-Key.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_My_PC_Key', 'images/MPS_HomePage_My-PC-Key-down.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_My_PC_Key', 'images/MPS_HomePage_My-PC-Key-over.gif'); return true;">
        <img name="MPS_HomePage_My_PC_Key" src="images/MPS_HomePage_My-PC-Key.gif" width="294" height="62" border="0" alt=""></a></td>
    <td>
      <a href="#"
        onmouseover="changeImages('MPS_HomePage_Forms_Key', 'images/MPS_HomePage_Forms-Key-over.gif'); return true;"
        onmouseout="changeImages('MPS_HomePage_Forms_Key', 'images/MPS_HomePage_Forms-Key.gif'); return true;"
        onmousedown="changeImages('MPS_HomePage_Forms_Key', 'images/MPS_HomePage_Forms-Key-down.gif'); return true;"
        onmouseup="changeImages('MPS_HomePage_Forms_Key', 'images/MPS_HomePage_Forms-Key-over.gif'); return true;">
        <img src="images/MPS_HomePage_Forms-Key-59.gif" width="55" height="1" border="0" alt=""></a></td>
    <td>
      <img src="images/spacer.gif" width="1" height="1" alt=""></td>
  </tr>
  <tr>
    <td rowspan="2">
      <img src="images/MPS_HomePage_33.gif" width="55" height="247" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="61" alt=""></td>
  </tr>
  <tr>
    <td colspan="7">
      <img src="images/MPS_HomePage_34.gif" width="294" height="186" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="186" alt=""></td>
  </tr>
  <tr>
    <td>
      <img src="images/spacer.gif" width="376" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="12" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="68" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="7" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="35" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="4" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="18" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="2" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="160" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="55" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="33" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="8" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="11" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="3" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="2" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="1" height="1" alt=""></td>
    <td>
      <img src="images/spacer.gif" width="229" height="1" alt=""></td>
    <td></td>
  </tr>
</table>
<!-- End ImageReady Slices -->

</body>
</html>
0
 

Author Comment

by:mdolle
ID: 20060061
hello again...
I have tried this, and it works in the .js file, however I now find that I must use the code in the .hta, which does not support WScript.  Unless you put something like :

 var shell = new ActiveXObject( "WScript.Shell" );

then use shell.Exec or shell.Run.

I need to check the values of meta tags in the document created by the .hta, specifically the Mobile Workload and any pages the user navigates to from there.   If the meta tag has a value of 'true', then another 'mobile Workload' must not be opened.  I have the tags set up correctly. So, it seems I must use:
objIE = new ActiveXObject("InternetExplorer.Application");
to be able to access the meta tags.

Also, there are no static variables in .hta or .js, and I need a way to tell if the code that creates the InternetExplorer.application and then navigates to MPS_URL( the Mobile Workload ) has been gone thru the first time, and any time after that I need to use document.title and open that page, if possible.

thanks, I will add more points to the question if I can.
Myra



0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 20060298
Points not needed, however I am not following you much.
Why do you not have access to WScript from the hta?
I did notice I could not instantiate using wscript  inside an hta but could call it from the command line.

I really think you might be better off at the forum where I found the other stuff
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1172493&SiteID=1
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question