XP drive mapping 
Author Message
 XP drive mapping

Using Visual Foxpro 6, how can I map a drive to a network
share, from within the application under Windows XP.

I have previously used the "NET USE" command within a
batch (.BAT) file and excuted using shell execute.

This has worked fine under Win9X, NT4, W2K, but fails to
work in XP and reports no errors in the OS.

Any ideas???



Mon, 29 Aug 2005 05:52:54 GMT  
 XP drive mapping
David,
Here is a message I saved off from Ed Rauh (RIP) using WSH:
"And yet another example - map a drive letter on the fly, specifying a distinctly different userid
and password for the attachment:

The Wscript.Network's MapNetworkDrive will take optional user name and password parameters, for
example:

oWSHNet = CREATEOBJECT('Wscript.Network')
oWSHNet.MapNetworkDrive('Q:','\\SomeServer\AppShare',.f.,'Foo','Bar')

maps drive Q: to \\SomeServer\AppShare share, does not update the user profile data to auto-map the
drive again, using the user id "Foo" and the password "Bar", and this functionality exists in even
the version 1 WSH implementation. The first two parameters -m the local device and the share name as
a UNC are mandatory. The third parameters is optional, when true, it updates the currently logged-in
user profile to auto-map this drive again when logging in. The fourth and fifth parameters are
optional user name and password; the Windows Login username and password will be passed if not
specified.

The Win32 API's WNetAddConnection3() is more capable, but is a bit of a PITA to implement in VFP -
there's sample code showing one approach in my NETRESOURCE class on UT, and ChristofLange wrote a
STRUCT class which makes the implementation easier if you don't want to use CLSHEAP for managing the
structure memory yourself. -- Ed Rauh"

Rick


Quote:
> Using Visual Foxpro 6, how can I map a drive to a network
> share, from within the application under Windows XP.

> I have previously used the "NET USE" command within a
> batch (.BAT) file and excuted using shell execute.

> This has worked fine under Win9X, NT4, W2K, but fails to
> work in XP and reports no errors in the OS.

> Any ideas???



Mon, 29 Aug 2005 07:14:10 GMT  
 XP drive mapping

There's no reason why it shouldn't - the 16-bit subsystem in XP is exactly
the same as 2K and NT.

--
* -
* - We get these rules to follow ... that and this, these and those ...
* -



Mon, 29 Aug 2005 17:00:29 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Foxpro 7.0 data concurency on mapped drive

2. Mapping net work drives

3. Mapping drives from VFP 5.0

4. map drive command?

5. GetDir() only works with mapped drives

6. Testing for connected mapped drive

7. How to map Win NT disk drive programmatically?

8. developing for data access on mapped drive

9. Mapping drives after establishing RAS

10. Is there a map network drive function VFP6?

11. VFP5-UNC names as opposed to mapping a drive

12. Drive mapping

 

 
Powered by phpBB® Forum Software