O T - Help Needed From You Knowledgable Folk

Aug 23, 2011 23 Replies

I know that this is not strictly DIY, more a computer group thread but I never seem to get any joy from those groups.



Basic problem. I wish print to a file for editing in Word a list of a folder contents.



I can do this using the DOS cmd prompt and then using dos commands to get to the folder and then "print > file.txt" then open Word and Open, do a search and then click ok.



Is there an easier way to do this. ?



Using Alt - PrnScreen only gives you an image of the screen.



Jim


Depends what you think is "hard" about the way you're already doing it?

But this should let you send your directory listing direct to the clipboard

formatting link
DIR /B C:\whatever | PIPE

then you can fire up word or notepad and paste the results in.

AnOther way could be to write a Word macro using the FileSystemObject COM object to read the folder contents and insert them direct to the word document.

Grrr, bloody fingers with a mind of their own ... make that

DIR /B C:\whatever | CLIP

There's also a windows program called LS that builds a file listing the contents of a hdd.

NT

The sign > redirects the output of any command. As an example. To create a text file as you describe in a file called dirlist.txt in the root of C: drive containing the listing of folder C:\TestFolder open a command prompt and use: dir c:\testfolder > c:\dirlist.txt

I use Terminal, get into the directory and do ls -la. I have a Word doc window open.

I then select all the interesting text in the directory listing, pick it up with the mouse and drag-n-drop it into the Word window. Done.

Easy.

is 'ls' a normal windows command?

I would have thought you could cut and paste from a 'finder' window..

C> dir/b > list.txt

Then read list.txt into Word.

You can do Select All and then copy and paste from a Finder window to a Word one. What you get is a list of files with no other info (such as sizes) but re-reading the OP perhaps that suffices.

LS is not a standard command that I am aware of up to Vista anyway... (you will get it if you install cygwin along with all the other usual

*nix style commands)

dir > file.txt

is pretty straight forward...

:

thats why I said program, not command

Unless things have radically changed from when I last used DOS, that doesnt list the contents of every directory on the entire disc in one go.

NT

it exists as an alias if you use powershell ... but the O/P asked for simpler ...

I thought that was what the O/P was doing already?

te:

I see modern windows does have that option. Never encountered it in win98.

NT

Was that what was requested? If so

DIR /S /B > file.txt

But having checked the original post, only one folder's worth of listing is required.

Ctrl-Alt PrnScreen will give just the window in focus to the clipboard. Paste into paint or your program of choice and print from there.

Fine if the list actually fits the window, otherwise very tedious.

and it doesn't help the OP who wants a text file for editing

Did he ask for that? In which case:

dir /s > file.txt

or for DOS 3.3 era and older:

chkdsk /v > file.txt

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required