Sign in to follow this  
Followers 0
Gnat

Virtual Directory creation in IIS6

5 posts in this topic

I have only read a couple of topics on this subject, but they didn't really cover everything that I was hoping for. I am trying to find out if there is a way to create a virtual directory on a remote IIS server and have that virtual directory be a redirect to another site. I found a URL (http://www.codeproject.com/csharp/VirtualDirectoryCreation.asp) of how to do this in C#, but I don't know the language, and cannot customize it for my purposes. Any help in the right direction would be appreciated...and code snippets would be even more appreciated.

Thanx

Share this post


Link to post
Share on other sites



OK, I have the VBS code that works...actually did that part myself...anyway, I am terrible at translating vbs into AutoIT, can someone please help...

Thanx

Set Root = GetObject("IIS://servername/W3SVC/7458/ROOT")

if (Err.Number <> 0) then

wscript.Quit

end if

Set Dir = Root.Create("IIsWebVirtualDir", "Test")

Dir.Path = "C:\ "

Dir.AccessRead = True

Dir.AccessWrite = False

Dir.EnableDirBrowsing = False

Dir.AppFriendlyName = "Test"

Dir.httpredirect = "http://localhost/website/project.aspx?projectID=217"

Dir.SetInfo

Set Dir = Nothing

Set Root = Nothing

Share this post


Link to post
Share on other sites

$Root = ObjGet("IIS://servername/W3SVC/7458/ROOT")
If Not IsObj($Root) Then
    Exit
EndIf
$Dir = $Root.Create("IIsWebVirtualDir", "Test")
$Dir.Path = "C:\"
$Dir.AccessRead = True
$Dir.AccessWrite = False
$Dir.EnableDirBrowsing = False
$Dir.AppFriendlyName = "Test"
$Dir.httpredirect = "http://localhost/website/project.aspx?projectID=217"
$Dir.SetInfo

Share this post


Link to post
Share on other sites

That code conversion works perfectly...Thanks for the help Senton-Bomb!

Share this post


Link to post
Share on other sites

No Problem :whistle:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0