>>Hi all, anyone familiar with an API call to map and then unmap a network drive (running VFP 6 on NT Workstation)?
>>
>>I am currently making a dos call and using the NET USE command. It works fine but is unsightly with the command window popping up each time! The application has to go to each drive on the network and create a table of each cad drawing that exists. The client can't keep all the drives permanently mapped due to the number of them (over 35!)
>>
>>I'm sure there has to be an API call to do it (especially since I'm not having to use passwords to map to each one). The app functions fine now, but I would like to eliminate the command window activity that pops up each time !NET USE p: \\DE705\USR1 and !NET USE p: /d is hit.
>>
>>
>>Any help would be appreciated.
>Hello Patric,
>
>Try
>
>DECLARE Integer WNetAddConnection IN WIN32API STRING @, STRING @, STRING @
>DECLARE Integer WNetCancelConnection IN WIN32API String @, INTEGER
>
>lcRemoteName = "\\Computer\Resource"
>lcPassword = "" && Connect using no password
>lcLocalName = "T:"
>
>? WNetAddConnection( @lcRemoteName, @lcPassword, @lcLocalName)
>*-- Return 0 if all is OK
>
>*-- Then to disconnect ( also returns 0 for OK)
>? WNetCancelConnection( @lcLocalName, 0)
That works great. Now, how do make the new drive mapping part of the search path?
Mark McCasland
Midlothian, TX USA