Document list through DOS

novicegeek

Member
Hey again, all,

I've got a DOS question. I'd like to print off a list of my documents in order to keep better track of them; it seems that MS never seemed to have thought of that as an option. I know there's a way to print out a list of your documents (like my Word documents) from DOS, but I've forgotten how it's done. I've searched the Internet, but I can't find how to do this.

Can someone help a brotha out?

Thanks.
 

strollin

Well-Known Member
You could do something as simple as "dir *.doc > doclist.txt" (no quotes) from a DOS prompt and that would put a list of all .doc files in the current folder into a a text file called doclist that you could then print out.

Are you looking for something that would list all .doc files in every directory on your drive or what? If you started from the root folder (C:\) and used "dir *.doc /S > doclist.txt" it would list every .doc file in every subdirectory on your drive.
 
Last edited:

novicegeek

Member
What the...?

Well, *sigh*, I tried it, but it didn't seem to work. Could it be that I'm putting spaces where no spaces should be (or visa versa)?
 

novicegeek

Member
I typed "dir *.doc > doclist.txt", without the quotes, of course, with various spacings, including the spacings included here. I came up with nothing. Typing dir * doclist.txt, will get me something, but nothing like a list of the documents I have.
 

strollin

Well-Known Member
After you run the command, it should produce the list of your documents in a file named doclist.txt which you can then open with Notepad. When you say you come up with nothing, are you saying the file doesn't get created or what? Even if you have no doc files to list, the file should still be created.
 

TrainTrackHack

VIP Member
You need the /S switch (I think it was S? Not on Windows now so can't check) to list the contents of your subfolders as well. Also, you'll probably want to do *.doc* or *.docx instead of just *.doc - the new (Office 2007 and onwards) formats have an extra x in the extension. *.doc* should match all doc and docx files. Of course, if you only have plain old doc files and it still doesn't work, I wouldn't know what's going on.

What directory are you doing this from?
 

novicegeek

Member
Hey all,

I truly appreciate your help in this. When I said it does nothing, I would get a "file not found" response. But when I did pull up Notepad, I got this:

Volume in drive C is HP_PAVILION
Volume Serial Number is C8B5-D188

Directory of C:\Documents and Settings\Owner


Not exactly what I was looking for - I don't think.

Anything else you can tell me?
 

NyxCharon

Active Member
What directory are you running this from?
Second, the /s flag is needed so
dir /s *.out > doclist.txt
 

novicegeek

Member
I'm in the Windows directory (C:\WINDOWS>). I was trying to pull up a list of my Word documents. Something close to what I want can be obtained by typing "dir/s /b >> listing.txt" or "dir/s /b *.doc .. doclist.txt". But when I type this in, I get a document that contains a list of everything in the directory (it's too big for Notepad, so I have to open it up in Wordpad). But what I'm wanting is simply a list of Word documents (or I'd settle for text documents).

I do appreciate all of your help. It's gotten me a lot closer than I've been before. I'm just not quite there yet.
 

novicegeek

Member
I'm in the Windows directory (C:\WINDOWS>). I was trying to pull up a list of my Word documents. Something close to what I want can be obtained by typing "dir/s /b >> listing.txt" or "dir/s /b *.doc .. doclist.txt". But when I type this in, I get a document that contains a list of everything in the directory (it's too big for Notepad, so I have to open it up in Wordpad). But what I'm wanting is simply a list of Word documents (or I'd settle for text documents).

I do appreciate all of your help. It's gotten me a lot closer than I've been before. I'm just not quite there yet.
 

novicegeek

Member
Darn it, I keep posting a reply to your question, but it doesn't show up here. I think I've figured something out. I can get a document list from version 6.1.7601, but I've got versions from 4.10.2222 on up. How do I get a document list from those versions?

By the way, when I got a document list from Notepad, the prompt and command looked a little something like this:
C:\WINDOWS>dir/s /b *.doc >> doclist.txt

I have a vague idea of what that means, but that's it.
 

novicegeek

Member
Okay, :eek: it actually does show up here. Please excuse (or ignore) my ignorant ravings in previous post. That was embarrassing.
 

TrainTrackHack

VIP Member
You need to be in your documents folder; if you're in C:\Windows, you'll only get a list of documents under your Windows directory and its subdirectories. On Vista and newer, the profiles are stored under C:\Users, you'll need to perform the operation under your profile directory (or wherever the files you want listed are stored), you can use the cd command to change directories ("cd C:\Users\Whateveryourusernameis" or so).
 
Top