Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

HTA in PE won't refresh span data without mouse activity(!)

Featured Replies

I'm writing an HTA whose body is broken down into tables with one of the top rows used for displaying status messages via a span. I'd like to include a 30 second countdown in the status before something automatically happens. Since HTA VBScript is too awesome to include a Sleep, I pause for 1 second by calling a subroutine that pings 127.0.0.1. This works fine when I run it on XP, but when I run it in PE, the message doesn't automatically refresh unless there's mouse / touchpad activity, even if I replace the pings with a simple msgbox. Has anyone else seen this? Is there any solution to it? Below is some sample code.

<html>
<head>
<title>Test</title>
<HTA:APPLICATION
ID="objTEST"
APPLICATIONNAME="TEST"
SCROLL="yes"
SINGLEINSTANCE="yes"
>
</head>

<script Language="VBScript">
Sub Window_OnLoad
ShowCountdown 30
End Sub

Sub ShowCountdown(howlong)
For i = howlong To 0 Step -1
If i <> 0 Then
status_msg.InnerHTML = "Device Imaging will begin in " & i & " seconds..."
Else
status_msg.InnerHTML = "Rebooting device to begin imaging..."
End If
DoSleep 1
Next
End Sub

Sub DoSleep(seconds)
set oShell = CreateObject("Wscript.Shell")
cmd = "%COMSPEC% /c ping -n " & 1 + seconds & " 127.0.0.1>nul"
oShell.Run cmd,0,1
'msgbox "pause"
End Sub

</SCRIPT>
<body>
<table width="100%" border>
<tr>
<td ALIGN=CENTER HEIGHT=40 style="font-size:12pt;"><span id="status_msg"></span></td>
</tr>
</table>
</body>
</html>


  • Author

wscript.sleep() doesn't work in HTA, that's the problem.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.