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.

Re: HTA Exit Code by Nathan

Nathan
Fri Oct 19 13:29:16 PDT 2007

On Oct 18, 10:36 pm, "Tim Kapple"<tkap...@yoursitenospam.com> wrote:
> 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.

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.


Re: HTA Exit Code by Tim

Tim
Sat Oct 20 02:11:00 PDT 2007

Thanks, at least I know were to look now.

"Nathan" wrote:

> On Oct 18, 10:36 pm, "Tim Kapple"<tkap...@yoursitenospam.com> wrote:
> > 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.
>
> 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.
>
>

RE: HTA Exit Code by JDogg

JDogg
Mon Nov 12 14:06:05 PST 2007

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.

"Tim Kapple" wrote:

> 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.
>

Re: HTA Exit Code by dmjohn88

dmjohn88
Wed Jan 09 11:48:57 CST 2008

Self.close will exit HTA.

Re: HTA Exit Code by Tom

Tom
Wed Jan 09 12:36:18 CST 2008

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/