I am using windows 7 64-bit on q6600 with 4gb ram.
I have a folder with 2 million files which are 10kB on average.
windows 7 explorer stops responding when I open the folder.
how can I overcome this?
You can overcome it by using a more sensible structure for your files. While Explorer will support directories with millions of files, it isn't designed for this sort of scenario and performance will be slow.
For more info, see this TechNet article:
Sorry, Windows cannot handle more than 80 thousand files in a folder, neatly and efficiently (On a Xeon 2.8Ghz server with 4GB RAM at least)
It starts to crash and burn near 60k.
At 200k it takes 2 days to enumerate the folder. We had this problem with badmail folder using Windows Exchange. The only way to overcome it is to make thousands of folders (that it can handle fine) with files inside those folders with more folders.
Otherwise you should seriously consider dumping that data into a SQL file, using SQLExpress which is free or MySQL which is also free. Write a small program to handle it and you will be good to go - that's what we did with our 200k files and now we have over 12 million emails sorted, with quick access.