Copying files From Server to Server

Posted on 2006-05-31
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
    LVL 6

    Expert Comment

    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

    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.
    LVL 1

    Author Comment

    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
    LVL 1

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now