This content has been marked as final. Show 10 replies
The first question is where is the other server? If it's on a local unc path or mounted you might want to consider letting the operating system do what it does best by using a cfexecute to issue a system level directory xcopy.
If it's a large copy set the timeout to 0 so that cfexecute can return immediately, otherwise, if you want to capture the output (as below), set the timeout to the appropriate amount. There are other parameters available for XCOPY, just type XCOPY /? in a command prompt.
<cfparam name="myExecute" default="">
name = "xcopy"
arguments = "\\server\share\path1\path2 c:\destination /S /R /Y /I" variable="myExecute"
timeout = "120" />
It is on another windows 2003 box...I tried this :
arguments = "\\bt2bcm\d$\cfusionmx\wwwroot \\bt2bdssc\vozturk$\Denemeler\ /S /R /Y /I"
The output = 0 File(s) copied
Why is that ?
sorry copying will be between 2 servers,,,
If you want to stick to CF, have you tried setting up a mapping to the destination server on your machine (assuming "another local server" means it's on your local network) and just using CFFILE (action=copy or move) to do the transfers?
I did dude..mapping....even xcopy dont copy the folders itself and its files.. xcopy sucks
If I remember correctly, XCOPY needs exact files specification(s), not just a directory, for source file(s). Like "C:\myfiles\*.*". The distination may be a directory, if exact copy is needed.
Another possibility is that the account CF is running under cannot access network or/and one of shares. Verify that you can copy a single file using CFFILE between these two shares.
Yes cffile works....the thing with xcopy is :
If I have a directory and some files in it (C:\g\*.* ), it wont create a directory "g" in the destination place..it just copy the files in that "g" folder....I need to copy the directory and its files to the destination like the way windows is ....
Use the /E attribute in Xcopy also to have it create directory structure if it doesn't already exist.
You also might want to look at using Robocopy from the Windows recource kit. It has alot more features to move files between servers.
I am using it but it does copy only the folder not the files in it..I need all the files within that folder and folder to copy into target destination...
Xcopy c:\g\*.* I:\ /e /t /y
You have to use UNC paths (\\server\share\directory\) instead of mapped logical drives. Mappings are attached to a user account. Therefore, they may not exist from the point of view of the account the CF is running.
I think your very first example will work, if you add wildcard files specification for the source and the directory tree copy flag.