Made ProcessCommand in ListFiles more efficient