Network Path

Network Path

Post by Thomas Ben » Wed, 17 Nov 2004 00:31:33

Hi NG,
i use "document.url" to get my current path but i get for example
"D:\Thommy\Test\index.html" (D is a NetworkDrive) but i need the whole
NetworkPath like "\\PC0815\Thommy\index.html"

Thx for any help,
Cya Thommy

(Sorry, my english is not the best)

Network Path

Post by U3RlcGhlbk » Thu, 18 Nov 2004 19:39:01

How do you generate "document.url", manually or thru script, maybe you could
make use of the WSH.NetWork network object to return the computer name when
generating the url file if possible, ie:

Dim oNetwork
Set oNetwork = CreateObject("Wscript.Network")
WScript.Echo oNetwork.ComputerName

Check out


Network Path

Post by Thomas Ben » Thu, 18 Nov 2004 20:06:59

Hi Stephen McC

Yes, i use a VBScribt

Thx for the code, but the result is my computer and i need the computer
which contain the HTML and VBScribt files
I can't use the I-Net, only NG

thx, cya Thommy

Network Path

Post by MV » Fri, 19 Nov 2004 02:35:05

> i use "document.url" to get my current path but i get for example

If the security context allows it, you can use a Scripting.FileSystem object
and its GetDrive method.

mappedPath = "D:\Thommy\Test\index.html"

set fso = createobject("scripting.filesystemobject")

driveName = fso.GetDriveName(mappedPath)

set drive = fso.GetDrive(driveName)

shareName = drive.sharename

msgbox driveName & " is mapped to " & shareName

uncPath = replace(mappedPath,driveName,shareName)

msgbox mappedPath & vbCrLf & uncPath

Michael Harris

Network Path

Post by Thomas Ben » Sat, 20 Nov 2004 20:07:48

Big THX,

it work now, thx

cya Thommy