In you cffile tag
you had
destination="#filemove.des
which is always going to give you the first record in the query.
That is why you need to change it to this
destination="#filemove.des
Main Topics
Browse All TopicsI need to query a database to get the originating path and move ALL files with in that originating path to the destination path(also in the database). Can someone help me out.
Here is what I have but it only moves the files from the first hit in the database query.
<cfquery name="filemove" datasource="server">
select * from filemove
</cfquery>
<cfloop query="filemove">
<cfdirectory action="LIST" directory="#origin#" name="directoryList">
<cfloop query="directorylist">
<cffile action="move"
source="#filecopy.origin##
destination="#filemove.des
</cfloop>
</cfloop>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Sorry about that
Try this
<cfquery name="filemove" datasource="server">
select * from filemove
</cfquery>
<cfloop query="filemove">
<cfdirectory action="LIST" directory="#origin#" name="directoryList">
<cfset destin_tmp=destin>
<cfloop query="directorylist">
<cffile action="move"
source="#filecopy.origin##
destination="#destin_tmp#"
</cfloop>
</cfloop>
COOL!
I was able to get it working....Thank you very much for you help.
The finishing touch I also had to add:
<cfset origin_tmp=origin>
So it looks like this:
<cfquery name="filemove" datasource="server">
select * from filemove
</cfquery>
<cfloop query="filemove">
<cfdirectory action="LIST" directory="#origin#" name="directoryList">
<cfset destin_tmp=destin>
<cfset origin_tmp=origin>
<cfloop query="directorylist">
<cffile action="move"
source="#origin_tmp##name#
destination="#destin_tmp#"
</cfloop>
</cfloop>
CFDevHead,
You should also add a comment to my other posting.
http://www.experts-exchang
Its the same question but I never got an answer. So I would like to give you the points for both.
Business Accounts
Answer for Membership
by: CFDevHeadPosted on 2006-02-09 at 09:39:54ID: 15914792
tRY THIS.
directoryl ist.name#"
<cfquery name="filemove" datasource="server">
select * from filemove
</cfquery>
<cfloop query="filemove">
<cfdirectory action="LIST" directory="#origin#" name="directoryList">
<cfloop query="directorylist">
<cffile action="move"
source="#filecopy.origin##
destination="#destin#">
</cfloop>
</cfloop>