that there are not paired quotes (there are three rather than two or four) so that the /k switch does not work properly. Actually, I rarely use the /k switch and quotes: here I would have just typed cmd in the Run box, and then C:\path\ /b > C:/dirlstn.txt at the cmd prompt ? substituting numbers for the n in the filename so that multiple directories can be handled prior to moving them to Excel.
The trouble with the /b switch alone, as suggested, is that (1) the subdirectories and files are intermixed; (2) it gives the file names of only one folder at a tine. The first can be changed by adding the /og switch; the subdirectories will then be listed in alphabetical order followed by the files in order. If you have files with the same name but different extensions, you might want to use the switch /ogne this orders directories first, then files by name and then by extension.
To get information on an entire tree that has many subdirectories, subdirectories, sub-subdirectories, etc., the above requires that you do all these one at a time ? a very tedious job. You can add the /s switch to the command line, and it will get all the filenames in all of the subdirectories at all levels. The problem is that the entire path is prefixed to each file name. I find such a list to be very difficult to read, and even more difficult to manipulate in Excel.
Omitting the /b switch provides the default directory format; here, each subdirectory is displayed separately. The directory path is displayed, followed by its contents. Also, the date, time, and file size are displayed in separate columns if you wish this information. This is a little more difficult to handle in Excel, but if you are familiar with Excel operations, you can figure it out, and macros will aid the operations. The details are too lengthy to discuss here; if you want to discuss this further, contact me through my profile.
You can view the appearance of the output by using the /p switch rather than redirecting the output to a file. Also, you can check out the various switches available in the DIR command by typing dir /? at the cmd prompt.
Hope this helps