Skip to content

Commit 2a61405

Browse files
Update Broadcast-ADUser-LogonMessage-viaGPO.hta
Signed-off-by: LUIZ HAMILTON ROBERTO DA SILVA <[email protected]>
1 parent e2d61f3 commit 2a61405

1 file changed

Lines changed: 38 additions & 32 deletions

File tree

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
1-
<!-- HTA file defining the display of the .png image for the logon message -->
2-
<!-- Author: Luiz Hamilton Silva - @brazilianscriptguy -->
3-
<!-- Update: May 9, 2024 -->
1+
<!--
2+
HTA that displays a 600x800 PNG for the logon message.
3+
Shows exactly the image with no extra borders; the window is centered and
4+
closes automatically after 25 seconds.
5+
6+
Author: Luiz Hamilton Silva - @brazilianscriptguy
7+
Updated: July 30, 2025
8+
-->
49

510
<html>
6-
<hta:application id="oHTA"
7-
border="none"
8-
caption="no"
9-
contextmenu="no"
10-
innerborder="no"
11-
scroll="no"
12-
showintaskbar="no"
13-
/>
14-
<script language="VBScript">
15-
Sub Window_OnLoad
16-
' Resize and position the .PNG image
17-
width = 600 : height = 800
18-
window.resizeTo width, height
19-
window.moveTo screen.availWidth\2 - width\2, screen.availHeight\2 - height\2
20-
21-
' Close the warning window automatically after 05 seconds
22-
idTimer = window.setTimeout("vbscript:window.close", 25000)
23-
End Sub
24-
</script>
25-
<body>
26-
<table border=0 width="100%" height="100%">
27-
<tr>
28-
<td align="center" valign="middle">
29-
' Image to open as logon message
30-
<img src="broadcast-userlogonmessage.png"/>
31-
</td>
32-
</tr>
33-
</table>
34-
</body>
11+
<hta:application id="oHTA"
12+
border="none"
13+
caption="no"
14+
contextmenu="no"
15+
innerborder="no"
16+
scroll="no"
17+
showintaskbar="no"
18+
/>
19+
20+
<script language="VBScript">
21+
Sub Window_OnLoad
22+
' Resize and center the window to match the image size
23+
width = 600 : height = 800
24+
window.resizeTo width, height
25+
window.moveTo screen.availWidth\2 - width\2, screen.availHeight\2 - height\2
3526

27+
' Auto-close after 25 seconds
28+
idTimer = window.setTimeout("vbscript:window.close", 25000)
29+
End Sub
30+
</script>
31+
32+
<!-- No margins, no borders, no visible background outside the image -->
33+
<body style="margin:0; border:none; background:transparent; overflow:hidden;">
34+
<!-- 600x800 container centered in the window -->
35+
<div style="position:absolute; top:50%; left:50%; width:600px; height:800px;
36+
margin-left:-300px; margin-top:-400px;">
37+
<!-- The image is already 600x800; no scaling is applied -->
38+
<img src="broadcast-userlogonmessage.png" width="600" height="800"
39+
style="display:block; border:none; padding:0; margin:0;" />
40+
</div>
41+
</body>
3642
</html>

0 commit comments

Comments
 (0)