0

I am using the following cmd prompt to acquire a list of the files and folders in a directory: v:>dir/s>name.txt.

The text file seems to be too small for my directory (3700 items), as it omits items listed lower on the directory. I initially thought it was the size of the text file causing the problem because of the last comment in this thread:

Is there a size limit on a text file?

I tried changing the prompt to v:\dir/s>name.xls. This worked, but when I opened the excel sheet, the list still omitted files lower down in the directory. This is surprising because according to microsoft,

http://office.microsoft.com/en-ca/excel-help/excel-specifications-and-limits-HP005199291.aspx

an Excel sheet can be filled up to 65, 536 rows, and my newly sheet created only went to row 3561.

I could solve the problem by running the cmd prompt at the subfolder level, but I will have to run this command many, many times. If you have a solution, it would be much appreciated.

Community
  • 1
  • 1
oymonk
  • 427
  • 9
  • 27
  • 1
    Changing the extension of a file does not magically change its format. `dir /s` produces text output. Changing it to `dir /s > name.jpg` would not produce an image of the directory content, and changing it to `name.xls` does not produce an Excel spreadsheet - it's a text file that happens to have an extension that is registered with Excel as the handler, but it's still a text file. – Ken White Mar 12 '14 at 17:38
  • How many rows do you get in the .txt file? What OS are you using? As a FYI text files do not have limits. Whatever is going on is related to the DIR command functionality. – Alan Waage Mar 12 '14 at 19:46
  • To Ken White: Thank you for your information regarding the file extensions. To Alan Waage: I'm using Microsoft Windows. I ran the DIR command again and found that the number of lines in the text file was 36 709. This was a larger number than the Excel file I produced a couple days ago, so I checked to see if various files had been captured on the list, and they all were. I am quite happy to have a complete list. If I figure out what I was doing wrong previously I will let you know. – oymonk Mar 14 '14 at 16:17
  • Oh man, I still need help. I ran the exact same command prompt five times. And each time it created a text file with a different number of lines! (More specifically: 2891, 2110, 3901, 8873, 2189) What is going on here? I am deriving the directory from a Network drive so I thought other people may be adding/deleting files. So I did the same test on my personal drive, and I similarly got a variation. Any advice? – oymonk Mar 14 '14 at 17:05

1 Answers1

0

This will give you a list of all the files, hidden or system or not.

dir /b /s /a-d >file.txt
foxidrive
  • 40,353
  • 10
  • 53
  • 68