Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drive letters and \\ server paths
Message
De
06/09/2001 11:44:44
 
 
À
06/09/2001 11:24:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00553153
Message ID:
00553192
Vues:
14
>>When starting an application from a network drive using an icon on the Windows
>>taskbar, this does not work if the drive on which the application.exe is
>>positioned is not indicated with a drive letter. For instance, if the app is found under \\RHBCML\ntprogs\appname we have a file access denied problem. If however we use H:\appname it works. I really need to use the \\rhbcml.... format to eliminate drive letter allocation problems. Can it be done!
>
>Either get rid of spaces in the computer name, path, or filename, or get the latest SP, where the "space + UNC" problem is solved. SP4 or later, I believe.
>

BZZT. Wrong!

Before you use a drive on an NT or Win2K based server, you need to explicitly attach that server, either by mapping the drive, or at least by logging into the server by indirectly referencing the share using one of the WNetGetConnection family of API calls - I normally use WNetGetConnection3() to map the target share to a null drive letter, passing the userid, domain name and password as needed to do this. This will cause the server OS to authenticate you, either based on authentication by a domain controller, or by local userid and password on the target system. If you do not give it this information, it will take the default information used by your station's current Windows Login username, domain (will be none in a workgroup or with a local account) and password. The connection can be released explicitly by invoking WNetCancelConnection() or WNetCancelConnection2(); once you've logged into the server, the same information used at login will be used for later authentication of the same session.

The issue here is one of relatively strong access control by the NT/2K/XP family of OSes when compared to Win9x derivatives using Share Level access control. Win9x family players will exhibit the identical behavior when using User Level access control, relying on the services of the domain controller to provide the authentication.

I have sample code in my NETRESOURCE class that demonstrates the use of WNetGetConnection3() to map a null drive letter to a share. Since it doesn't eat a drive letter or establish a permanent connection, it's relatively harmless, and it solves the issue of authentication.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform