Sunday, April 8, 2007

Custom Popup Message

HTA or HTML Applications can be used for many things, installers, configurations pages, popups and much more. Here I demonstrate how to use them as a custom popup that your network users will recognize not as a spyware/trojan but has a message from the admin group. The background can consist of your company logo and the Admin pictures or something distinguishable.
This particular HTA file can be pushed to the machine and displayed to let the user know that he is out of compliance for patches. This can be accomplished by many ways:
1. Create a collection where the scan package is 1 or 2 versions back from where it should be. Pushing this down can warn the users that many many patches are about to install or that he/she needs to bring their laptop in for repairs because the Windows update feature isn't working correctly
2. Create a collection where the latest patch number MS07-0xx is not installed 2 weeks after Patch Tuesday.


---------------Popup.hta ----------
<head> <title>Message from <network admin group></title> <body background = "background.jpg">
<HTA:APPLICATION APPLICATIONNAME="NetworkGroup" SCROLL="NO" SINGLEINSTANCE="yes" WINDOWSTATE="normal" SYSMENU="no">
</head>
<script language="VBScript">
Sub Window_Onload window.moveTo 200,200 window.resizeTo 820,600 end sub
Sub Closeme window.close() end sub
</script>
<body >
<table width="790" border=0> <tr bgcolor="Yellow" height="8"> <td align="center"> Caution Caution Caution Caution Caution Caution Caution Caution Caution Caution Caution
</td> </tr> <tr height="350"> <td valign="center" > <font size="5" color="#0000FF" >
This system is not fully patched and is therefore a risk to our office. You are receiving this notification because your system is out of compliance for the following reason: <;br><br> This system may be experiencing problems receiving the MS updates. Please restart your PC. More patches may install after the restart. <br></font> </td> </tr>
<TR valign="bottom"> <td align="center" height="80" > <input type="button" value="Close Window" name="Closeout" onClick="Closeme" style="background:#f3f; "> </td> </tr> <tr bgcolor="Yellow" height="8"> <td align="center"> Caution Caution Caution Caution Caution Caution Caution Caution Caution Caution Caution </td> </tr> </table>
</body>


---------------------------
The color is to get your attention, change as needed.

See this MSDN article for more information:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp