Useful Trick with CMD

This one is pretty simple yet powerful trick with cmd (command promt). Have you ever had hunders of files in a folder and you needed to get the filenames in to excel or notepad?

Well its easy with cmd.

STEPS:

1. Launch CMD

There are multiple ways to launch Command Prompt but easiest way is to press windows+r and type CMD to the new opened window and hit enter

2. Set the pathway of the folder

Now you have to set the path of the folder in cmd that has your files. Again there are multiple ways to do this but the easiest one is to

copy it from address bar. Lets assume that pathway of your folder is “D:\New folder”. In order to set the pathway in cmd you need to type

cd D:\New folder and hit enter

3. Get the filenames to notepad

Now all you need to do is to type dir > list.txt /b

*dir > – all filenames will be sorted alphabetically

*list.txt – is a filename that will store the data. You can set it to anything, just note that if you want it in notepad then keep “.txt” as extension

*/b – removes all the unneccessary details and keeps only filenames. Note that if you want to sort filenames according to creation date, dont use it, just type dir > list.txt

For other tips you can click here