Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return name of file in VBScript

Status
Not open for further replies.

Microbe

Programmer
Oct 16, 2000
607
AU
How do I return the name of the file that contains a script.

i.e. I want to do a VBscript equivalent of the Javascript "document.location" and also "document.title"

Any help appreciated.

Steve Davis
hey.you@hahaha.com.au
 
Steve,

The document object is part of the Browser DOM, it does not exist in ASP code. Did I misunderstand your question?

-pete
 
Did you misunderstand the question? I'm not sure, but I didn't get the answer :eek:)

Here's what i am trying to do...

Basically, I am trying to make a log file. I want my script to log when a page was hit, what was the referer etc. What I am trying to avoid is hard coding the name of the page that the script is sitting in.

So I want to create an include file that will work out the filename of the page in which it is included.

As I said, using javascript, I could use document.location, but what is the equivalent (if there is one) in VBscript?

Thanks in advance for your help...whether or not you can answer my question.

Steve Davis
hey.you@hahaha.com.au
 
Well I think "FileSystemObject" object can help you.
where it's methods can return most of a files properties.The follwing code is for start:
<%
Dim sPageName
sPageName=Request.QueryString (&quot;PAGENAME&quot;)
Set file1=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
strPath=Server.MapPath(&quot;mainPath&quot;)
.
.
.
 
I ended up figuring it out using a combination of Javascript and VBscript...

Unfortunately, I don't have the code in front of me, but if anyone is interested, drop a reply and I will post it.

Steve Davis
hey.you@hahaha.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top