Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ASP is there any way for an ASP page to know which directory it is being executed from?

0 views
Skip to first unread message

Dan Branca

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to
I have a single ASP page that is duplicated in a number of directories. I
would like to put some common VB script in an include file. I would like the
VB script to be able to determine which directory this particular ASP file
is stored in.

I need to have this functionality, please do not respond with suggestions on
restructuring the system.

TIA
Dan

Jeroen Ritmeijer

unread,
Oct 29, 1998, 3:00:00 AM10/29/98
to
You can get the current directory with server.mappath(".")

Jeroen Ritmejer
www.xs4all.nl/~jarit/asp/


Dan Branca wrote in message ...

Laurent Combémorel

unread,
Nov 3, 1998, 3:00:00 AM11/3/98
to
Dan, you can use Request.ServerVariables("PATH_TRANSLATED") which gives you
the physical disk location of the ASP page requested.
Laurent Combémorel
Internet & Intranet Consulting
ASTON
lcomb...@aston.fr

Dan Branca a écrit dans le message ...

GPW

unread,
Nov 5, 1998, 3:00:00 AM11/5/98
to
Dan,
You can get the virtual directory from Request.ServerVariables:

iPos = InStr(2,Request.Servervariables("URL"),"/")
strVirDir = Left(Request.Servervariables("URL"),iPos)

If the URL is http://www.server.com/MyApp/MyPage.asp then after
executing this code, strVirDir will contain
"http://www.server.com/MyApp"

I'm not sure off the top of my head how to get the physical directory.

Hope this helps,

GW

0 new messages