dir /s not returning ALL subdirectories

I need a list of all files and folders in a giant directory. This ends up being approximately 1000 folders and 20000 files.

Being a command line noob, I started out just by doing "dir>file.txt" while cd-ed to each individual folder.

Now im trying to just do this by using "dir /s>file.txt" on the top level directory.

It looks like the command works properly, and the file gets created, the issue is that the .txt file contains only 19 of the 107 top level directories.

Anyone have any ideas on why the command is crapping out less than a fifth of the way in? Is there some kind of max number of values returned for the command or something?

6

2 Answers

I dont know if there are limits for dir

Try the tree command in the command prompt tree /f

If that doesnt work, try using powershell and use get-childitem -recurse

3

To include hidden and system files\folders use dir /a /s>file.txt

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like