Académique Documents
Professionnel Documents
Culture Documents
Description
This document will demonstrate how to push out a detailed and professional looking message box to all active clients. This process can be used to send out outage announcements or even company announcements.
Files needed
LDMsgBox.hta HTML File that is displayed to the user LDMsgBox.ico Icon file that is used in the compiled message box application Cleanup.vbs VB Script that is used to remove all files after the form is closed LDMsgBoxImages Folder to store images in LDMsgBoxImages\blank.gif Image used in the form to create transparent space LDMsgBoxImages\header.jpg Image used as a header, you can replace this with a company logo LDMsgBox Script.nsi Nullsoft compiler code. This document specifies which files to be compiled
Below is a sample of an .HTA file. I will do my best to break this down, but to be honest its very easy to understand once you start using it and modifying the file. I have also provided a link at the beginning of this document that provides information on what HTA settings there are and how they can be controlled. *********************************************************************************** This section defines how the application looks and works. It includes HTA variables as well as HTML variables for the document. <head> <title> </title> <HTA:APPLICATION APPLICATIONNAME="IT Support Center Notification" BORDER="thin" BORDERSTYLE="raised" SCROLL="no" SINGLEINSTANCE="yes" CAPTION="yes" SYSMENU="no" SHOWINTASKBAR="no" contextMenu="no" SELECTION="no" windowState="normal" > <style type="text/css"> <!-body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; } body { margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; } .style2 { font-size: 8pt; font-weight: bold; } --> </style></head> *********************************************************************************** *********************************************************************************** This section is the scripting portion of the document. Each specific action of the application is split in to Sub Functions. Sub Window_OnLoad sets the size of the window and centers the window on the users primary screen Sub CloseButton is called from the HTML code and is used to close the window as well as calling a cleanup script (VBS) that will remove all the files that pertain to the message box. <script language="VBScript"> Sub Window_OnLoad window.resizeTo 800,440 intTop = (screen.height - document.body.clientHeight) / 2 intLeft = (screen.width - document.body.clientWidth) / 2 window.moveto intLeft,intTop End Sub Sub CloseButton
strComputer = "." Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") strPath = objFSO.GetAbsolutePathName(".") strCleanup = "wscript " & Chr(34) & strPath & "\Cleanup.vbs" & Chr(34) If objFSO.FileExists(strPath & "\Cleanup.vbs") Then objShell.exec(strCleanup) self.close() Else self.close() End If End Sub </script> *********************************************************************************** *********************************************************************************** The section is the HTML portion of the document. The HTML code can be modified either in Notepad or a HTML editor such as Dreamweaver. As you modify the HTML code please be aware of the size of the document as you may have to update the size of the form in the Window_OnLoad Sub at the beginning of the document. <body STYLE="font:14 pt verdana; color:003366"> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><img src="LDMsgBoxImages/header.jpg" width="800" height="72" /><br /> <table width="780" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><strong>Service Outage for the Data Center - Monday, December 15th, 2008 10:00AM to 4:00PM PST<br /> <br /> </strong> <p>In a continuous effort to maintain and improve the operation of our Information Systems, a service outage for the Data Center has been scheduled for <strong>Monday, December 15th, 2008 10:00AM to 4:00PM PST</strong></p> <ul type="disc"> <li><strong>Reason For The Down Time: </strong>Hardware Maintenance</li> <li><strong>What is Affected: </strong>Access to all E-mail related services</li> <li><strong>Duration: </strong>Approx. 6 hrs. (10:00 AM - 4:00 PM PST.) </li> <li><strong>Groups Affected: </strong>All employees accessing E-mail related services.</li> </ul> <p>If you have any questions or need assistance after service has been restored, please contact the IT Dept.</p> <p>IT Dept<br /> <a title="mailto:email@company.com" href="mailto:email@company.com">email@company.com</a><br /> Toll Free: 555.123.4567<br /> <br /> <span class="style2">Supervisors/Managers - Please share this communication with employees who do not have access to e-mail or a computer.</span></p> </td> </tr> <tr> <td valign="top"><div align="left"><img src="LDMsgBoxImages/blank.gif" width="18" height="16" /></div></td> </tr> <tr> <td valign="top"><div align="center"> <input type="button" value="Close" name="close_button" onClick="CloseButton"> </div></td>
</tr> <tr> <td valign="top"><img src="LDMsgBoxImages/blank.gif" width="18" height="16" /></td> </tr> </table></td> </tr> </table> </body>
Since this is a pre-built delivery method, please verify the settings on the following sections before use. Network Usage - Verify Use download from source to deploy files is selected Reboot - Verify Never Reboot is selected.
Click Save.
Drag the query to the scheduled task that was created earlier in this document. Right-Click on the scheduled task and select "Start Now".