How to get current ASP script running file name without using FileSystem object
We can get the current file name of the asp script without using the FileSystem object. The reason for this is we want to develop a common script which can be used ( or included ) in any file to display various file system properties. The FileSystem object needs the file name as input so we will try to develop this script which can be used as a input to the FileSystem object for further development.
The best example is to develop a script which will display the last modified date of the file. Let us start with how to read the script name in ASP. The code used below will give the file name along with the directory or the path name.
Dim my_array, fname
fname = Request.ServerVariables("SCRIPT_NAME")
The above code will display the file name with full path. For example if the present file is in my_file directory and file name is test.asp then the output will be