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!

Use MapPath in a Script (not ASP)?

Status
Not open for further replies.

jasonp45

Programmer
Aug 23, 2001
212
US
I am writing some VB6 code to run on my intranet, and what I want to do is pull FTP files from a remote server. I've already written the code to pull a file, and now I want to write something to list the files in the remote FTP directory.

Apparently I can do this via something like:
strPhysicalPath = Server.MapPath(strPath)
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysicalPath)

In a .vb/s file I can simply leave off the 'Server.' part to create the FileSystemObject, but that doesn't seem to to work with MapPath. Anyone know how I can do this, other than using the INET control (which I'd rather avoid)?
 
I'm not commenting on your overall object, only the task at hand. AFAIK, there is no equivalent of the IIS Mappath method in VBS or the Windows Script Host.

However, since you appear to be familiar with the FileSystemObject, you can use it's GetAbsolutePathName method.

Set oFSO = CreateObject("Scripting.FileSystemObject")
strPhysicalPath=oFSO.GetAbsolutePathName(strRelativePath) Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top