Question: I'm new to VBscript and would like some help on moving a specific number of files from one directory to another.

Right now I currently have a set of 3 files(for testing purposes) with different extensions and would like to move all of the files if there are exactly 3 files(no more and no less) inside the source directory. My code so far is:

```
Set fso=CreateObject("Scripting.FileSystemObject")

Set fldr=fso.getFolder("C:\folderA")
for each file in fldr.files
    If fldr.files < 3 then
            msgbox("Need more files")
    Else
            fso.MoveFile "C:\folderA\*", "C:\folderB"
    End If

```

Any help would be greatly appreciated.
Thanks, everyone!

Answer: 
1. Use `fso.getFolder("C:\folderA").Files.Count` to get the number of
files in `C:\folderA`.
2. Do this **before** - not in - a loop over the files (to move them)
3. Consider to move (and re-create) the folder if it contains exactly 3 files
```
Set FSO=CreateObject("Scripting.FileSystemObject")
Set fldr= FSO.GetFolder("C:\FolderA")
Set Collec_Files= fldr.Files
For Each File in Collec_Files
    If Collec_Files.count < 3 then
      msgbox("Need more files")
    Else
      FSO.MoveFile "C:\FolderA\*", "C:\FolderB"
    End If
Next

```