Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating virtual directories programmatically 1

Status
Not open for further replies.

pkailas

Programmer
Jun 10, 2002
555
US
Does anyone know how to create Virtual Directories in IIS5 using VBScript? I know how to do this manually, but need to do this programmatically.

Thanks,



_______
I love small animals, especially with a good brown gravy....
 
I use a simple bat file like:

net use x: \\server1\share

then call this from vbs with wscript.shell.run

 
To create a virtual directory using the Iisvdir.vbs administration script
1.
From the Start menu, click Run.

2.
In the Open box, type cscript iisvdir.vbs /create "SampleWebSite" VirtualDirectoryName x:\path. [red]Substitute your Web site name, virtual directory name, and path to the physical directory as appropriate.[/red]

3.
Click OK.



I hope you find this post helpful.

Regards,

Mark
 
This would probably work better if I were using IIS 6.0. However, we onlyl have IIS 5.0.

Any other ideas?



_______
I love small animals, especially with a good brown gravy....
 
I don't have access to an IIS 5 system, do you not have that same script?

I hope you find this post helpful.

Regards,

Mark
 
No.. I looked up that script on MSDN and it's only for IIS 6.0



_______
I love small animals, especially with a good brown gravy....
 
Hmm, sorry I am out of suggestions other than it is time ot upgrade. ;-)

I hope you find this post helpful.

Regards,

Mark
 
Yeah, fortunately, I see that Microsoft offers a "Web Server" edition for Windows 2003 for less than $400. I may have to spring for a copy!

_______
I love small animals, especially with a good brown gravy....
 
you may be interested in looking at adsi stuff

Set Parent = GetObject("IIS://" & ServerName & "/W3SVC/" & IntSiteIndex & "/ROOT")
Set NewVirtualDirectory = Parent.Create("IIsWebVirtualDir", "NameOfVirtualDirectory")
NewVirtualDirectory.SetInfo
NewVirtualDirectory.Path = "c:\websites\....\.."
NewVirtualDirectory.SetInfo
Set NewVirtualDirectory = Nothing
Set Parent = Nothing
 
mrmovie,

Can this be done via ASP and VBScript?

_______
I love small animals, especially with a good brown gravy....
 
cant see why not, providing the context in which the ASP is being run has permissions..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top