Paramater list too long while chmod

Hi i am transferring the files(around 10000) from the Windows sever to the UNIX server in that i run a command chmod 777 filename.txt
but it is taking a longer time as it gives chmod for each and every file.
So i thouught of giving the permission from the UNIX itself and i tried running
chmod 777 filename.txt and it is throwing an error Parameter list is too long.
So i tried it with find . -name "filename*.txt" -exec chmod 777 {} \;

still i get the error parameter list is too long!
Any other options to avoid this error wud be highly appreciated!
Thanks in advance!

See if this works. Make sure you are in the required directory.

 
ls filename*.txt | xargs chmod 777

I hope even

ls filename*.txt | xargs chmod 777

would fail paramater list too long as it tries to expand filename*.txt for ls.

I think the following command would work:

ls -1|grep \\.txt$|xargs chmod 777