Go to DOS prompt (enter 'cmd' in run box of Win XP or 'command' in run box of earlier Windows version...
Type 'dir /?' to get an idea of what are the options to get directory listing...
Enter 'dir <parameters> >filename.txt' to get the directory listing output to the required file...
For example, if you want a list of all the files in the directory and all subdirectories, and store it list.txt file, enter 'dir /s >list.txt'
Arun