Copying files From Server to Server

Posted on 2006-05-31
Medium Priority
Last Modified: 2010-04-30
I am trying to copy files(.tar) from a Server on our network and then rename it to a subfolder from the same directory. I have tried using the FSO.CopyFile zipFileBeg, extFolder format but now I am getting a Permission Denied error. When accessing the Server with Remote Desktop a username,pwd is entered. I can however use Explorer, using \\Server and go right to the files without logging from my client. Are there any clean solutions to this problem? Thank you for your time Experts.
Question by:edfreels

Expert Comment

ID: 16803716
Your 2 cases are totally different. When you log on a server and use remote desktop to copy files from it to another server, the "Copy" process was running on the server; when you use FSO.CopyFile on your own computer, although you are copying files from Server A to Server B, the "Copy" process itself was running on your client computer.

So you need access permission to both servers when you do it. I suggest you to use WshNetwork object to map dirves, then you can copy the files more easier.

    Dim oWsn As Object
    Set oWsn = CreateObject("WScript.Network")
    Call oWsn.MapNetworkDrive("V:", "\\ServerA\DirecoryA", , "MyName", "MyPassword")
    Call oWsn.MapNetworkDrive("W:", "\\ServerB\DirecoryB", , "MyName", "MyPassword")

Then you can just copy files from V driver to W driver, just like your own computer.

LVL 15

Expert Comment

ID: 16803724
Do you have any permission to write in the server? Does the server has a firewall? having a firewall and having no permission to write in the server will give you this prompted messages.

Author Comment

ID: 16809045
In response to both Junglerover77 and JackOfPH, I feel ashamed to say it, but it was as simple as having the Microsoft Scripting Runtime Reference checked in Project. This was a transition for me as I have always used Access db's(dont tell anyone!). Once that was part of my References in my Projet my FileSystemObject process went well. Thank you for the quick responses. I was able to resolve this on my own so I request this question get pulled.

Thank you in advance1

Accepted Solution

DarthMod earned 0 total points
ID: 17100924
PAQed with points refunded (500)

Community Support Moderator

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question