Oops, I didn't read your request carefully enough the first time.

Here's a copy version:

require 'fileutils'
Dir.chdir 'C:/'
files = Dir.glob('**/*.*)
files.each do |fname|
  FileUtils.copy File.absolute_path(fname), 'D:/document/' +
    File.basename(fname)
end

-- 
Posted via http://www.ruby-forum.com/.