Return the folder of the current ASP file

ASPToday ASP Tip of Day for 17 April 2001, by Ian Vink

Return the folder of the current ASP file being accessed.

set fs = server.createObject("scripting.fileSystemObject")

Full_ASP_FILE_PATH = server.mapPath(request.serverVariables("PATH_INFO"))

PATH_ONLY = fs.getParentFolderName(Full_ASP_FILE_PATH)

response.write "This ASP page is being run in the folder: " & PATH_ONLY

Leave a Reply

Your email address will not be published. Required fields are marked *


*