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.
Locked
User avatar
huntsecker
Posts: 99
Joined: Tue Jan 22, 2008 8:05 am

HTA timeout option ?

Post by huntsecker » Thu Feb 21, 2008 9:46 pm

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

User avatar
jvierra
Posts: 13725
Joined: Tue May 22, 2007 9:57 am
Contact:

HTA timeout option ?

Post by jvierra » Thu Feb 21, 2008 10:14 pm

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.

User avatar
jvierra
Posts: 13725
Joined: Tue May 22, 2007 9:57 am
Contact:

HTA timeout option ?

Post by jvierra » Mon Feb 25, 2008 1:06 am

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
Joined: Tue Jan 22, 2008 8:05 am

HTA timeout option ?

Post by huntsecker » Thu Feb 28, 2008 7:27 am

Cheers for the responses guys

User avatar
jvierra
Posts: 13725
Joined: Tue May 22, 2007 9:57 am
Contact:

HTA timeout option ?

Post by jvierra » Wed May 27, 2009 9:03 am

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
Joined: Wed May 27, 2009 8:26 am

HTA timeout option ?

Post by jtokach » Thu May 28, 2009 12:49 am

Thank you for the reception and code!

User avatar
jtokach
Posts: 2
Joined: Wed May 27, 2009 8:26 am

HTA timeout option ?

Post by jtokach » Thu May 28, 2009 2:07 am

I am getting "access denied" when trying to display the modeless or modal dialogs.

Locked