Retrieve IIS Applicaton Path

R

Raterus

I need to routine that will return what 'Request.ApplicationPath' would return in asp.net.

If you are not familiar with that, I just need to know the IIS virtual directory the application is running in, relative to the server root.

I've looked through all the server variables, but don't see anything that will help me, without having to do some string parsing (and even then I'd be guessing at the virtual directory).

A return value would look something like this...where "myapp" is the virtual directory
"/webapps/myapp/"

Any help is much appreciated!
--Michael
 
R

Raterus

I found an answer,

Function ApplicationPath()
sApplicationPath = LCase(Request.ServerVariables("APPL_MD_PATH"))
ApplicationPath = Split(sApplicationPath, "root")(1)
End Function

Call Response.Write(ApplicationPath() & "<br><br>")

I need to routine that will return what 'Request.ApplicationPath' would return in asp.net.

If you are not familiar with that, I just need to know the IIS virtual directory the application is running in, relative to the server root.

I've looked through all the server variables, but don't see anything that will help me, without having to do some string parsing (and even then I'd be guessing at the virtual directory).

A return value would look something like this...where "myapp" is the virtual directory
"/webapps/myapp/"

Any help is much appreciated!
--Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top