dir /on /b /s > list.txt
Creates a file called list.txt with a list of the files, folders and sub folders in that directory.