Also, GC should very rarely be triggered manually and program exits automatically upon leaving main. If files.Length > 65536, for-loop would move the same files over and over until File.Move throws PathTooLongException, or loop infinitely if no files match criterion.