
Translating local path to a UNC ?
Quote:
> Have a local path, such as:
> strCurrentPath = fso.GetFolder(".").Path
> Which returns something like:
> D:\Temp2\Scripts
> And I'd like to translate it to something like:
> \\MyNode\D$\Temp2\Scripts
> I could probably parse this and do it programmatically, but I am
> hoping there is a function or object somewhere in the OS which
> does this, perhaps less likely to break with future OS releases.
> --
> ______________________________________________________________________
> Lee Gillie, CCP Remove NOSPAM to E-Mail
> Online Data Processing, Inc. - 3501 N. Haven - Spokane, WA 99207-8500
Look at the WSH Network object's EnumNetworkDrives and
VBScript's
GetDriveName method. For example, ...
Set ofs = CreateObject("Scripting.FileSystemObject")
sDrv = ofs.GetDriveName("D:\Temp2\Scripts")
Set oWN = WScript.CreateObject("WScript.Network")
Set oDrvs = oWN.EnumNetworkDrives
i = 0
Do While i < oDrvs.Count
if oDrvs.Item(i) = sDrv Then
WScript.Echo oDrvs.Item(i), oDrvs.Item(i + 1)
Exit Do
Else
i = i + 2
End if
Loop
Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/