HTA timeout option ?

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 14 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
huntsecker
Posts: 99
Last visit: Mon Jan 04, 2016 1:47 am

HTA timeout option ?

Post by huntsecker »

Hey Guys,Just a quick question is there a way in a HTA to set a timeout period ? I'm creating a HTA which has a "machine name" text-input if the user enters some random name which WMI has no user-rights to say www.google.com then the hta waits for a long time, was hoping I could put in something that after 6 secs or so would just inform them to check there spelling.I'm writing this in vbscript btw.Cheers
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

HTA timeout option ?

Post by jvierra »

You really can't do anything like that in an HTA.
You can set the timeout period on a WMI connection which would probably accomplish what you want.

VBScript and HTAs don't allow multiple thread and don't allow preemptive callbacks normally.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

HTA timeout option ?

Post by jvierra »

A secondary window will work to some degree. Inmany cases this is not what is needed. I uploaded a file (above) that shows various ways to accomplish :asychronous" like output.

The uploaded code shows how to do this to even the main window. The issue is using teh correct kind of control and properly refreshing the objects as you write to them. The demo code shows a number of ways to do this.
User avatar
huntsecker
Posts: 99
Last visit: Mon Jan 04, 2016 1:47 am

HTA timeout option ?

Post by huntsecker »

Cheers for the responses guys
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

HTA timeout option ?

Post by jvierra »

Hello and Welcome to ScriptingAnswers!

Sorry but this thread is almost one and one-half years old and has no mention of "asynch" that I can see.

What is it you are looking for?

The attachment that is missing above :
uploads/2491/HTASampler.zip

Not really async as mentioned but does show various methods of getting around issues with HTML windows.

Run HTA-Files.HTA and click on teh "ModelessDlg" button. Note how messges can be sent and received via callback between windows. This can be used to manage some processes.
jvierra2009-05-27 16:49:25
User avatar
jtokach
Posts: 2
Last visit: Thu May 28, 2009 2:07 am

HTA timeout option ?

Post by jtokach »

Thank you for the reception and code!
User avatar
jtokach
Posts: 2
Last visit: Thu May 28, 2009 2:07 am

HTA timeout option ?

Post by jtokach »

I am getting "access denied" when trying to display the modeless or modal dialogs.
This topic is 14 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked