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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File/Directory on remote server

Status
Not open for further replies.

phuzz

Programmer
Mar 14, 2001
5
CA
Hello.

I am in the process of creating a series of ASP pages for
updating documents. The process includes the creation of
directories and the copying of files from the local server
(where the scripts are run) to a remote server. I have tried using the FileCopy method with UNC in the source and destinations but havent been very successful. In your opinion what are the best methods for creating directories and copying files to a remote server.

Note: I do have an active IUSR_Machine account with the proper permissions on the remote server.


 
phuzz,

Try the following:


drive = "your drive letter"
share = "\\server\sharename"
false = "update user profile"
user = "Username"
password = "Username's password"

Set fso = Wscript.CreateObject("Scripting.FileSystemObject")
Set wshnetwork = Wscript.CreateObject("Wscript.Network")
WshNetwork.MapNetworkDrive drive, share, false, user, userpassword

source = "C:\mydir\mydocument.doc"
target = drive & "\your_directory\your_filename"
fso.CopyFile source, target, true

Cheers,
Fengshui1998


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top