Link to home
Start Free TrialLog in
Avatar of edfreels
edfreelsFlag for United States of America

asked on

Copying files From Server to Server

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.
Avatar of junglerover77
junglerover77

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.

Regards,
Jungle
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.
Avatar of edfreels

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of DarthMod
DarthMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial