path = "F:\pic"
$prefix = "pp"def renameFile(path)
serial = 1
Dir.foreach(path) do |f| fullfilename = path + "/" + f
if f == "." or f == ".."
elsif File.directory?(fullfilename)
elsif File.file?(fullfilename)
File.rename fullfilename, "#{path}/#{$prefix}%03d.jpg" % [serial]
serial = serial + 1
end
endend #def renameFile(path)
renameFile(path)