Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mapping to network drive using .BAT file
Message
From
23/03/2004 13:00:24
 
 
To
23/03/2004 11:39:57
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00888895
Message ID:
00888945
Views:
19
>>Tim
>
>I wouldn't use a bat file. You can connect from within VFP.
>
>
>Declare integer WNetCancelConnection in WIN32API String lpName,short lForce
>Declare integer WNetAddConnection in WIN32API ;
>  string lpRemoteName,  ;
>  string lpPassword,  ;
>  string lpLocalName
>
>*Add connection
>WNetAddConnection("\\W0028109792\DATAWARE", "", "R:")
>
>*Remove connection
>*WNetCancelConnection("R:",0)
>
>PS: WNetAddConnection2 and WNetCancelConnection2 supersedes and have more options for connections like dipslaying a prompt for username and pw for user to connect.
>Cetin


That is probably the best solution for Tim.

Another possible option is to use WSH:
oWSHNet = CREATEOBJECT('Wscript.Network')
oWSHNet.MapNetworkDrive('R:','\\SomeServer\AppShare',.t.,'uid','pwd')


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform