Open a command prompt (Start -> Run -> cmd Enter ) Navigate ( cd ) to the directory whose files you want to list. Enter dir > output_file_name (e.g., dir > C:\dir. txt ) and press Enter .