Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

$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

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
×
×
  • Create New...