Prev: Scripts in console - color coding output
Next: WMI
From: Lando on 26 Jun 2006 16:33 Is is possible to write a vbs script to write to an iframe in an external HTA file that is running? I have a vbscript runs at login for mapping drives, etc. The script opens an html dialog to display the login results as they are processed. I would like to convert the html dialog to an hta application so I don't need to host the login html on one of our web servers and just have the script open the hta file from the same location the script runs. Any sample code would be GREATLY appreciated! Thanks!
From: McKirahan on 26 Jun 2006 17:23 "Lando" <lando(a)noemails.com> wrote in message news:ugOUW$VmGHA.4164(a)TK2MSFTNGP03.phx.gbl... > Is is possible to write a vbs script to write to an iframe in an external > HTA file that is running? I have a vbscript runs at login for mapping > drives, etc. The script opens an html dialog to display the login results as > they are processed. I would like to convert the html dialog to an hta > application so I don't need to host the login html on one of our web servers > and just have the script open the hta file from the same location the script > runs. Any sample code would be GREATLY appreciated! > > Thanks! Why not just convert the VBS to an HTA?
From: maximillianx on 26 Jun 2006 17:27 That, or you might try to write an html progress file in the users %temp% folder if your AV policy won't bark too much... Regards... Rob "McKirahan" <News(a)McKirahan.com> wrote in message news:WM2dnYY8Mcq8zT3ZnZ2dnUVZ_uqdnZ2d(a)comcast.com... > "Lando" <lando(a)noemails.com> wrote in message > news:ugOUW$VmGHA.4164(a)TK2MSFTNGP03.phx.gbl... >> Is is possible to write a vbs script to write to an iframe in an external >> HTA file that is running? I have a vbscript runs at login for mapping >> drives, etc. The script opens an html dialog to display the login results > as >> they are processed. I would like to convert the html dialog to an hta >> application so I don't need to host the login html on one of our web > servers >> and just have the script open the hta file from the same location the > script >> runs. Any sample code would be GREATLY appreciated! >> >> Thanks! > > Why not just convert the VBS to an HTA? > >
From: McKirahan on 26 Jun 2006 18:22 "McKirahan" <News(a)McKirahan.com> wrote in message news:WM2dnYY8Mcq8zT3ZnZ2dnUVZ_uqdnZ2d(a)comcast.com... > "Lando" <lando(a)noemails.com> wrote in message > news:ugOUW$VmGHA.4164(a)TK2MSFTNGP03.phx.gbl... > > Is is possible to write a vbs script to write to an iframe in an external > > HTA file that is running? I have a vbscript runs at login for mapping > > drives, etc. The script opens an html dialog to display the login results > as > > they are processed. I would like to convert the html dialog to an hta > > application so I don't need to host the login html on one of our web > servers > > and just have the script open the hta file from the same location the > script > > runs. Any sample code would be GREATLY appreciated! > > > > Thanks! > > Why not just convert the VBS to an HTA? Here's an example that updates a 'textarea' with timestamped progress messages. The most recent message is on top. <html> <head> <title>process.hta</title> <HTA:Application ID = "HTA" ApplicationName = "Process" Border = "thin" BorderStyle = "normal" Caption = "yes" Icon = "" MaximizeButton = "yes" MinimizeButton = "yes" ShowInTaskBar = "yes" SingleInstance = "yes" SysMenu = "yes" Version = "1.0" WindowState = "maximize" > <script type="text/vbscript"> Option Explicit Const cHTA = "process.hta" Sub doProcess(form) '*** ' Processing... '**** If form.StartStop.value = "Start" Then form.StartStop.value = "Stop" Call doStatus(form,"") Call doStatus(form,"Started.") '* '* Your processing logic here ................................... '* Else Call doStatus(form,"Stopped.") form.StartStop.value = "Start" End If End Sub Sub doStatus(form,what) '*** ' Update 'textarea' with timestamped progress messages. '**** If what = "" Then form.Status.value = "" If form.Status.value = "" Then form.Status.value = FormatDateTime(Now,2) Else form.Status.value = FormatDateTime(Now,3) & _ " -- " & what & vbCrLf & form.Status.value End If End Sub </script> </head> <body> <br><br> <table align="center" border="1" width="500"> <tr valign="top"> <th> <table bgcolor="#EEEEEE" border="0" width="500"> <tr> <td align="center"> <br> <h4>process.hta</h4> <b>This HTML Application (HTA) does stuff...</b> <br> <br> </td> </tr> <tr> <td align="center"> <form name="formHTA"> <input type="button" name="StartStop" value="Start" style="width:100px" onclick="doProcess(formHTA)"> <br><br> <textarea name="Status" cols="50" rows="8" readonly></textarea> </form> </td> </tr> </table> </th> </tr> </table> <script type="text/javascript"> var what = "\n\t Timestamped"; what += "\n\n\t\t progress messages"; what += "\n\n\t\t\t are displayed here."; document.formHTA.Status.value = what; </script> </body> </html>
From: Lando on 27 Jun 2006 08:46
Thank you very much for the sample code but my current vbs script is over 1500 lines long and converting it to HTA would take some time. I may look at converting it later but there are some limitations in HTA such as no wscript.sleep, etc that would have an impact on my script. Does anyne know if my inital question is possible? Having a vbs file write to a iframe in a running HTA. Thanks again for everyones help. You guys are always such a good resource. Lando |