Click here to Skip to main content
15,913,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am getting problem in copy file from one server to another server.

Also, my domain also different.

For example,

Server1
-------
Server1 : Test1
Domain : Domain1
Folder : ABC


Server2
-------
Server1 : Test2
Domain : Domain2
Folder : XYZ


JavaScript
<%
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
strLocation1 = "\\Test1\ABC\*.aspx.vb" 
strLocation2 = "\\Test2\XYS\" 


objFSO.CopyFile strLocation1, strLocation2,true
Set objFSO = nothing

%>


This is not working. It says Path not found or access denied.

Give me some solution for this...
Posted
Updated 10-Aug-12 10:02am
v2

 
Share this answer
 
You need to Share folders on both servers(unless otherwise you should b able to access it with hidden admin share: \\ServerFullyQualifiedDomainName\D$\ABC\ assuming ABC is in D: drive)...

So first Share ABC for read and list contents
Share XYZ for read/write/modify permissions.

VB
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
strLocation1 = "\\Test1.Domain1\ABC\*.aspx.vb" 
strLocation2 = "\\Test2.Domain2\XYS\" 
 

objFSO.CopyFile strLocation1, strLocation2,true
Set objFSO = nothing


Remember this should be FQDN(Fully Qualified Domain Name) : Test1.Domain1

Thanks,

Kuthuparakkal
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900