>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.
oWSHNet = CREATEOBJECT('Wscript.Network') oWSHNet.MapNetworkDrive('R:','\\SomeServer\AppShare',.t.,'uid','pwd')