Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect to network share with username password via prg 1

Status
Not open for further replies.
Sep 17, 2001
673
US
I need to connect to a network share with a username and password from within a foxpro .prg. Check for the existence of a file. Then copy the file down to local pc if file is found. Any suggestions? (Biggest concern is how to connect to server share with login and password).


The more I learn the more I find I know nothing.

Rob
 

This requires Windows Scripting to be installed:
Code:
oNet = CreateObject('WScript.Network')    
oNet.MapNetworkDrive('I','\\myserver\myFiles',.T.,'mike','password')

Or without window scripting:
Code:
net use DriveLetter: \\Computername\sharename
(Use "net use /?" command at the command/msdos prompt to see get help and more options like how to put username and password)
example: net use x: \\myserver\myshare



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks Mike I am going to try this:

EXECSCRIPT("run net use \\192.168.1.1\ShareName MyPassword /user:MyUser")

I like not having to worry about having something installed for applications that will be used by many.

The more I learn the more I find I know nothing.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top