Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


web server root directory

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,47200
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> web server root directory
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 web server root directory - 5/18/2007 2:30:52 AM   
  kelphis

 

Posts: 10
Score: 0
Joined: 4/19/2007
Status: offline
im using the Microsoft.XMLDOM to load an xml file in my vbscript.  however when I use the load function to load an XML file if doesnt load the xml file properly.  I used the "Save" function to see where it saved xml files and it put it in my "windows\system32" folder.  is there a way to get the root reference of where the web server is installed?
 
 
Post #: 1
 
 RE: web server root directory - 9/4/2007 7:24:48 AM   
  mcds99


Posts: 421
Score: 4
Joined: 2/28/2006
Status: offline
I know that the root of IIS is in C:\inetpub\wwwroot

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to kelphis)
 
 
Post #: 2
 
 RE: web server root directory - 9/21/2007 1:31:16 AM   
  webber123456

 

Posts: 37
Score: 0
Joined: 9/20/2007
Status: offline
use server.Mappath to get physical location of virtual file reference.

Server.MapPath( Path )
Parameters Path Specifies the relative or virtual path to map to a physical directory. If Path starts with either a forward (/) or backward slash (\), the MapPath method returns a path as if Path is a full virtual path. If Path doesn't start with a slash, the MapPath method returns a path relative to the directory of the .asp file being processed. Remarks The MapPath method does not support relative path syntax (.) or (..). For example, the following relative path, ../MyDir/MyFile.txt, returns an error.
The MapPath method does not check whether the path it returns is valid or exists on the server.
Because the MapPath method maps a path regardless of whether the specified directories currently exist, you can use the MapPath method to map a path to a physical directory structure, and then pass that path to a component that creates the specified directory or file on the server.
Examples For the examples below, the file data.txt is located in the directory, C:\Inetpub\Wwwroot\Script, as is the test.asp file that contains the following scripts. The C:\Inetpub\Wwwroot directory is set as the server's home directory.
The following example uses the server variable PATH_INFO to map the physical path of the current file. The following script
<%= server.mappath(Request.ServerVariables("PATH_INFO"))%><BR>
produces the output
c:\inetpub\wwwroot\script\test.asp<BR>
Because the path parameters in the following examples do not start with a slash character, they are mapped relative to the current directory, in this case C:\Inetpub\Wwwroot\Script. The following scripts
<%= server.mappath("data.txt")%><BR>
<%= server.mappath("script/data.txt")%><BR>
produce the following output
c:\inetpub\wwwroot\script\data.txt<BR>
c:\inetpub\wwwroot\script\script\data.txt<BR>
The next two examples use the slash characters to specify that the path returned should be looked up as complete virtual paths on the server. The following scripts
<%= server.mappath("/script/data.txt")%><BR>
<%= server.mappath("\script")%><BR>
produce the following output
c:\inetpub\script\data.txt<BR>
c:\inetpub\script<BR>
The following examples demonstrate how you can use either a forward slash (/) or a backslash (\) to return the physical path to the home directory. The following scripts
<%= server.mappath("/")%><BR>
<%= server.mappath("\")%><BR>
produce the following output
c:\inetpub\wwwroot<BR>
c:\inetpub\wwwroot<BR>

(in reply to kelphis)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> web server root directory Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts