Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

w2ksp4.exe, WwwxxXdbf, procmail "FROM_MAILER" patch, Use of assignment to $[ is deprecated at /usr/local/sbin/apxs line 86. , wwwxxx vim, mysql closing table and opening table, 800c5000, setgid operation not permitted, pciehp: acpi_pciehprm on IBM, WWWXXX.DBF

Links

XODOX
Impressum

#1: Error Numbers, VBScript

Posted on 2008-04-09 10:43:27 by Paolo

Hello everyone,

I'm writing a small VBScript that will check in IIS if a given Virtual
Directory exists on the WebSite with lowest site id (weird :) ) and if it
exists will delete it.

Now on to the problem #1:
In order to check if vdir exists i do:
On Error Resume Next
.... blah blah blah...
Set objVDir = objService.GetObject("IISWebVirtualDir", "MyVDir")
if Err.Number <> 0 then
....
end if

I'd like to be able to display a MsgBox if an error occurred retrieving the
VDir obj, BUT NOT if the VDir does not exist... So the question is: Where
can I find the error values in order to check this???

TIA
Paolo

Report this message

#2: Re: Error Numbers, VBScript

Posted on 2008-04-10 01:30:53 by Ken Schaefer

WScript.Echo Err.Number

will give you the error numbers/values. Just test each of the circumstances
you outline so that you know what numbers of check in your code.

Cheers
Ken

--
My IIS blog: http://adopenstatic.com/blog

"paolo" <paolobitech@newsgroup.nospam> wrote in message
news:eivBb4hmIHA.5080@TK2MSFTNGP02.phx.gbl...
> Hello everyone,
>
> I'm writing a small VBScript that will check in IIS if a given Virtual
> Directory exists on the WebSite with lowest site id (weird :) ) and if it
> exists will delete it.
>
> Now on to the problem #1:
> In order to check if vdir exists i do:
> On Error Resume Next
> ... blah blah blah...
> Set objVDir = objService.GetObject("IISWebVirtualDir", "MyVDir")
> if Err.Number <> 0 then
> ...
> end if
>
> I'd like to be able to display a MsgBox if an error occurred retrieving
> the VDir obj, BUT NOT if the VDir does not exist... So the question is:
> Where can I find the error values in order to check this???
>
> TIA
> Paolo
>

Report this message

#3: Re: Error Numbers, VBScript

Posted on 2008-04-10 18:08:09 by Paolo

> WScript.Echo Err.Number
>
> will give you the error numbers/values. Just test each of the
> circumstances you outline so that you know what numbers of check in your
> code.
>
> Cheers
> Ken

Thanx Ken, i will do like that

Cheers
Paolo

Report this message