tlavedas
Mon Nov 29 07:21:02 CST 2004
You want a 'Wscript.Quit ExitCode' statement. See the documentation for the
Quit method.
WSH 5.6 documentation download (URL all one line
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en
Tom Lavedas
===========
"PKA" wrote:
>
>
> "McKirahan" wrote:
>
> > "PKA" <pka@bnpparibas.com> wrote in message
> > news:A8215069-5803-4D1A-B435-6EF908D52612@microsoft.com...
> > > The code:
> > > File.Copy(FichierCible)
> > >
> > > Produce this error:
> > > C:\win32app\exploit\HFTrader-PDL\HFTPDL.vbs(89, 4) Microsoft VBScript
> > > runtime error: Path not found
> > >
> > > But the return code of the script is 0.
> > > I can handle this specific error with the "on error" clause but how can I
> > > do to exit with a return code <> 0 when i have an unhandled error?
> >
> > How are you getting a return code?
> > > > The script is run inside a .bat and I check the ERRORLEVEL
>
> > Also, how about seeing if the file exists before trying to copy it?
> > > > My question is more general. If I have an unhandled error in a script I want the return code be other than 0 like in perl, ksh or other script languages.
> >
> >