>I need to map to a drive on another computer on the network. The network techs gave me the following batch file
>
> NET USE R: /D
> NET USE R: \\W0028109792\DATAWARE
>
>In the app's startup I do a
>
> RUN Yadayada.BAT
>
>Sometimes I see a DOS window and everything is great and other times I do not see a DOS window (and my users have to run the BAT file manually from a shortcut on the desktop). Most of my users are running Win XP. We are still using VFP 6 SP5.
>
>I am sure there is a better way of doing this in VFP (the politics of getting a login script are a problem at the moment).
>
>Thanks.
>
>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
WNetAddConnection("\\W0028109792\DATAWARE", "", "R:")
PS: WNetAddConnection2 and WNetCancelConnection2 supersedes and have more options for connections like dipslaying a prompt for username and pw for user to connect.
Cetin