Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Having problems with Creating a script used in a web setup..

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  socket pooling in iis6  
Author Message
geronimi

External


Since: Dec 09, 2005
Posts: 2



(Msg. 1) Posted: Fri Dec 09, 2005 7:53 am
Post subject: Having problems with Creating a script used in a web setup project (asp.net, vb)
Archived from groups: microsoft>public>inetserver>iis (more info?)

Having problems with Creating a script used in a web setup project
(asp.net, vb): creating/deleting IIS virtual

directories.......

So, in that script I want to add a V dir (InfoViewTEST) into another
VDir (EformsTEST)

Problem is that it doesn't to anything, can anybody help?
I don't understand "On Error Resume Next" well I think...
Is there not a better way to handle errors? (If obj = null then .... in
stead of If Err.Number = 0 )

I'm new to vb scripting, so some good tutorial links will do me good,
also tips about scripting in a web setup

project.........

CODE:
-----------

Dim strVDName 'IIS Virtual Directory Name
Dim IIsWebVDir 'ADSI IIS Object
Dim objRoot 'ADSI Root Object
Dim objVdir 'ADSI Virtual Dir Object

strRootName = "EformsTEST"
strVDName = "InfoViewTEST"

On Error Resume Next
'Check if directory is already registered,
'this will produce an error if it is not
Set IIsWebVDir = GetObject("IIS://localhost/W3SVC/1/Root/strRootName/"
& strVDName)

If Err.Number = 0 Then
'No error so directory registration exists, we need to remove it
Set IIsWebVDir = Nothing
Set IIsWebVDir = GetObject(
"IIS://localhost/W3SVC/1/Root/strRootName/" & strVDName )
Set objVdir = IIsWebVDir.Delete( "IIsWebVirtualDir", strVDName)
WScript.Echo "Virtual directory gedeleted"
Else
WScript.Echo Err.Number
End If

' Use the Windows ADSI container object "Create" method to create
' a new virtual directory.
Set IIsWebVDir = GetObject("IIS://localhost/W3SVC/1/Root/strRootName")
Set IIsWebVDirObj = IIsWebVDir.Create("IIsWebVirtualDir",strVDName)

' Use the Windows ADSI object "Put" method to
' set some required properties.
IIsWebVDirObj.Put "Path", "C:\Program Files\Unique World
Software\InfoView"
IIsWebVDirObj.Put "AccessRead", True
IIsWebVDirObj.Put "AccessScript", True
' Set Directory Settings to Integrated Windows authentication (without
Anonymous acces)
IIsWebVDirObj.Put "AuthFlags", 4

' Use the Windows ADSI object "SetInfo" method to
' save the data to the metabase.
IIsWebVDirObj.SetInfo
WScript.Echo "Virtual directory gecreëerd"

 >> Stay informed about: Having problems with Creating a script used in a web setup.. 
Back to top
Login to vote
geronimi

External


Since: Dec 09, 2005
Posts: 2



(Msg. 2) Posted: Mon Dec 12, 2005 12:12 am
Post subject: Re: Having problems with Creating a script used in a web setup project (asp.net, [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

yes, it is a .vbs script,

It does the creating well, but there are some wierd things that happen.

What is the best way of debugging such a script?

 >> Stay informed about: Having problems with Creating a script used in a web setup.. 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]