Will all files in this folder be a .pdf with matching .txt file? How many
files are we looking at? Are there other file extensions that need checked?
In the same sentence you say "copy the first 2 files" but then say "move
them to another folder". So do you want to copy or move the matching files
to another folder?
What code have you written so far?
Based on your vague description, this will do what you ask. This version
actually moves the files. If you just want to copy them, you will have
to modify the instruction accordingly.
=====================mover.vbs======================
Set fso=CreateObject("Scripting.FileSystemObject")
source="d:\path1\"
target="d:\path2\"
Set fldr=fso.getFolder(source)
for each file in fldr.files
if right(lcase(file.name),4)=".pdf" then
call mover(lcase(file.path))
end if
next
sub mover(f1)
f2=replace(f1,"pdf","txt")
if fso.fileExists(f2) then
fso.MoveFile f1,target
fso.MoveFile f2,target
wscript.sleep 60000
end if
end sub
==================================================
--
Crash
"Facts are stubborn things, but statistics are more pliable."
~ Laurence J. Peter ~
yes. they are all pdf with matching txt file. i have over 1000 files.
no other extensions. sorry i meant move. so far i have a vbscript that
moves the files but the problem is that i need to be able to pick up
the files that match one pair at a time and then stop the process for
1 - 2minutes and then continue and so on. Thanks for your quick
response.