Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HTA Exit Code

635 views
Skip to first unread message

Tim Kapple

unread,
Oct 19, 2007, 1:36:00 AM10/19/07
to
Hello, I have been using the wscript.Exit() in my vbscripts for some time to
return the status of my scripts to the calling app. I have started using HTA
and I can not figure out how to get the same funtionality. With out a return
code to my calling app my HTA app is of no use to me. I have done some
searching and found that the object used for Wscript.exit can't be used in
HTA but there has to be a way to set an exit code.

Please help :(

Thanks in advance.

Nathan

unread,
Oct 19, 2007, 4:29:16 PM10/19/07
to

There isn't a way to do this directly from HTA. You can write your
results to a text file or spawn some other process and read the
results from there.

Hope that helps.

Kapple@discussions.microsoft.com Tim Kapple

unread,
Oct 20, 2007, 5:11:00 AM10/20/07
to
Thanks, at least I know were to look now.

JDogg

unread,
Nov 12, 2007, 5:06:05 PM11/12/07
to
We use an HTA as a front end for our Altiris tasks too.

HTA doesn't have an equivalent to wscript.quit so to work around this
limitation, we have a vbscript spawn the HTA application and use a registry
value that acts as a sort of status place holder for that particular package.
When the HTA application is finished, the vbscript reads the data in the
registry value and does a wscript.quit with the appropriate return code so
that Altiris can be alerted if an error occured.

dmjo...@yahoo.com

unread,
Jan 9, 2008, 12:48:57 PM1/9/08
to
Self.close will exit HTA.

Tom Lavedas

unread,
Jan 9, 2008, 1:36:18 PM1/9/08
to
On Jan 9, 12:48 pm, dmjoh...@yahoo.com wrote:
> Self.close will exit HTA.

Yes, but that does not provide for issuing an exit code, which was the
original poster's request. The wscript.quit method can take an
exitcode argument which is then available for testing by a calling
process. An HTA does not.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/

0 new messages