You have a habit of creating multiple threads with the same question, just slightly reworded to ones you have previously created (on the same day at times).
Would you please explain why this solution http://www.qaforums.com/ultimatebb.p...c;f=4;t=012481 doesn't meet your needs? It is a slightly different question, but with very little research on your part it would fit your "new" need. It has been practically given to you on a platter.
Please stop this bad habit before it becomes a liability. You also might want to take a step back and learn some basic skills before continuing down the path of test automation. Look into basic OS skills, basic programming skills, and researching skills. They will all go a long way to getting you where you think you need to be.