Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UNC Names
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00297612
Message ID:
00297802
Views:
23
>>>Does anyone know how to take something like c:\mydir\junk.txt and turn it into \\computerName\computerDrive\mydir\junk.txt
>>>
>>There's a Win32 API that converts a mapped drive letter into the corresponding UNC - the FAQ contains a small code example showing how it works.
>>
>>If the drive is not mapped, but is a local resource, it's a considerably more difficult problem, since there's no assurance (1) that the drive is accesible by anyone on another machine, or if it is shared, (2) what share to use as a base reference if more than one UNC can resolve the path.
>
>Thanks for the info Ed the FAQ was somewhat helpfull. I think I need to go the extra step and resolve the UNC for the local resource.
>
>Basically I shouldn't have to worry about someone trying to access the local files from another spot.
>
>I did'nt quite understand the point about "what share to use as a base reference if more than one UNC can resolve the path."
>

I want to share C:\somedir\somesub to the net. I have a hidden administrative share at C:\ called C$, another more restrictive public share at C:\ called Croot, a share of c:\somedir called c_somedir, a less restrictive hidden share of c:\somedir called CSubdirhid$, and three shares of c:\somedir\somesub called share1, share2 and share3, all with different access permissions. Which is the correct one to resolve a reference to C:\SomeDir\Somesub\MyTable.DBF? All can be used.

In addition, the set of available shares is stored and retrieved in different ways for different systems. While ADSI can simplify some of this, it's a far more complicated thing to install and configure if you aren't aware of how ACLs (Access Control Lists) are maintained for the network, and what is and is not a potential server.

If you go through the registry, different clients on any given OS have their own subkeys to maintain the share lists and ACLs, and different OS have their own registry formats. I've written code to approach this, and it is non-trivaial, and requires detailed understanding of who will require access and what privileges are needed.

>What is the next step?
>

If you aren't intimately familiar with the registry structures of all systems involved, I'd suggest investigating ADSI or a third-party library. realize that there is a significant commitment outside of VFP to make ADSI work on all systems.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform