Click to See Complete Forum and Search --> : Where am I on the local server?


jpmoriarty
10-07-2004, 04:54 AM
Is there some script I can run that will tell me where on the local server my scripts are located?

I'm running on a local intranet, and to get to a database I've uploaded I think I need to give my script the local address, eg. c:\windows\wwwroot\intranet or some such.

Any ideas? Many thanks in advance,

John

javaNoobie
10-07-2004, 05:49 AM
The following will show the script's location.

Server.mapPath(Request.ServerVariables("SCRIPT_NAME"))

russell
10-08-2004, 02:13 AM
Also, if you know the relative path, then you can access it with Server.MapPath(relative_path_here)

For example:

strPath = Server.MapPath("/mystuff/data/file.ext")

strPath Would now be something like this (depending on the actual location on your server) "c:\inetpub\wwwroot\mystuff\data\file.ext".