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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the web page directory in VB Script

Status
Not open for further replies.

garethMann

Programmer
Jun 28, 2005
5
US
How do i get the directory of the webpage in VBscript?

I tried:

Set WshShell = CreateObject("WScript.Shell")

sDir = WshShell.CurrentDirectory

But for some strange reason this returns "C:\WINDOWS\system32"

But my asp page is in "my documents" So why can't i get this?
 
Perhaps something like this ?
sDir = Server.MapPath(".")


Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Click on:
Project | Components

and select
Microsoft Internet Controls

This will put an icon of the planet earth in your toolbox. Click the planet icon in the toolbox and then in a form draw a box using your mouse. This creates a browser in the area where you drew the box.

This will load Google in the form when you run the code:

Private Sub Form_Load()
WebBrowser1.Navigate "End Sub

Hope this helps.

MrMajik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top