Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UNC -- Universal Naming Code
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00190705
Message ID:
00190928
Views:
13
>>>>1) Other than the set printer to name on Windows NT, does VFP handle or process the non drive letter mapped volumes with the Universal Naming Code: \\servername\ResourceNameLikeVolumeOrPrinter
>>>>2) If VFP has other uses for the UNC than set printer to name on Windows NT, what are they and how do we use them?
>>>
>>>I switched my app from mapped drives to UNC and have seen only a couple of problems.
>>>1 The setup wizard when given a UNC keeps telling me I am out of disk space and would I like to continue. I choose to continue and after 8 more disk space warnings the wizard completes and everything is OK. I switched the setup wizard back to a mapped drive and everything was OK, so I know it was the UNC that causes the error.
>>>2 Since my app has gone to total UNC, I have had to deal with the fact that the user may not be logged in to the server (as they have no mapping, thus they sometimes dont feel they have to log into the server). If anyone out there knows how I can force a log in when my app detects that the UNC does not exist, I would appreciate the help.
>>
>>You might look at temporarily mapping a drive using WNetAddConnection() and then immediately releasing it using WNetCancelConnection(). the same functionality is availble through Wscript.Network if you have the Windows Scripting Host available. You can trap the return from WNetAddConnection() so that you can tell when a server really is down or the user doesn't have access rights to the targeted share.
>
>Where can I find the documentation on WNetAddConnection()?

The MSDN Platform SDK documentation is the best source, if you've got access to it, it's part of the API. The declaration for it should look like:
DECLARE INTEGER WNetAddConnection IN Win32API ;
 STRING cRemoteUNC, ;
 STRING cPassword, ;
 STRING cLocalDrive
WNetAddConnection will use the current Windows Login userid to attach the remote system; if another userid is needed, you'd need to use a different API call like WNetAddConnection2(), which allows you to specify both userid and password.
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
Reply
Map
View

Click here to load this message in the networking platform