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

Cannot copy a file to a unc path

Status
Not open for further replies.

Grunty

Technical User
Joined
Jul 30, 2002
Messages
100
Location
GB
Can anyone help me with this?

I am trying to do a simple file copy:

Const OverwriteExisting = TRUE

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\servername\e$\filepath\filename.ini" , "\\servername\e$\otherfilepath\",OverwriteExisting

A similar script using CopyFolder works fine with the folders in the same locations, but when I run this to copy a single file, I get an access denied message.

Is there a problem with copying to UNC paths?

Thanks

 
no problem with UNC paths.
all i can suggest is that you check for the file existance first, then check for the destination folder.

or, try and drop the \ form the destination path.
or change the destination path to be

"\\sernamer\e$\otherfilespath\filename.ini
 
Thanks for your reply, adding the filename to the destination path did the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top